The following commit has been merged in the master branch: commit fa9b6e6133cdb9e1519efef3929c2d6eb2b73a4c Author: Guillem Jover <guil...@debian.org> Date: Mon May 25 07:55:14 2009 +0200
s-s-d: Refactor process schedule priority range checks Move into a new function, so we avoid warnings due to unused variables. diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index 49e1630..261b6e6 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -507,10 +507,26 @@ parse_umask(const char *string, int *value_r) } static void +validate_proc_schedule(void) +{ +#ifdef _POSIX_PRIORITY_SCHEDULING + int prio_min, prio_max; + + prio_min = sched_get_priority_min(proc_sched->policy); + prio_max = sched_get_priority_max(proc_sched->policy); + + if (proc_sched->priority < prio_min) + badusage("process scheduler priority less than min"); + if (proc_sched->priority > prio_max) + badusage("process scheduler priority greater than max"); +#endif +} + +static void parse_proc_schedule(const char *string) { char *policy_str, *prio_str; - int prio = 0, prio_min, prio_max; + int prio = 0; policy_str = xstrdup(string); policy_str = strtok(policy_str, ":"); @@ -534,15 +550,7 @@ parse_proc_schedule(const char *string) } else badusage("invalid process scheduler policy"); -#ifdef _POSIX_PRIORITY_SCHEDULING - prio_min = sched_get_priority_min(proc_sched->policy); - prio_max = sched_get_priority_max(proc_sched->policy); - - if (proc_sched->priority < prio_min) - badusage("process scheduler priority less than min"); - if (proc_sched->priority > prio_max) - badusage("process scheduler priority greater than max"); -#endif + validate_proc_schedule(); } static void -- dpkg's main repository -- To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org