taskset: coding style fixes

Reindentation and deletion of few empty lines etc. There is no
actual code changes in this patch.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2011-07-17 20:00:19 +02:00 committed by Karel Zak
parent 6f45c0e9ff
commit 02ad010012
1 changed files with 17 additions and 17 deletions

View File

@ -37,13 +37,10 @@
struct taskset { struct taskset {
pid_t pid; /* task PID */ pid_t pid; /* task PID */
cpu_set_t *set; /* task CPU mask */ cpu_set_t *set; /* task CPU mask */
size_t setsize; size_t setsize;
char *buf; /* buffer for conversion from mask to string */ char *buf; /* buffer for conversion from mask to string */
size_t buflen; size_t buflen;
int use_list:1, /* use list rather than masks */ int use_list:1, /* use list rather than masks */
get_only:1; /* print the mask, but not modify */ get_only:1; /* print the mask, but not modify */
}; };
@ -116,7 +113,8 @@ static void do_taskset(struct taskset *ts, size_t setsize, cpu_set_t *set)
/* set new mask */ /* set new mask */
if (sched_setaffinity(ts->pid, setsize, set) < 0) if (sched_setaffinity(ts->pid, setsize, set) < 0)
err(EXIT_FAILURE, _("failed to set pid %d's affinity"), ts->pid); err(EXIT_FAILURE, _("failed to set pid %d's affinity"),
ts->pid);
/* re-read the current mask */ /* re-read the current mask */
if (ts->pid) { if (ts->pid) {
@ -127,7 +125,7 @@ static void do_taskset(struct taskset *ts, size_t setsize, cpu_set_t *set)
} }
} }
int main(int argc, char *argv[]) int main(int argc, char **argv)
{ {
cpu_set_t *new_set; cpu_set_t *new_set;
pid_t pid = 0; pid_t pid = 0;
@ -157,13 +155,15 @@ int main(int argc, char *argv[])
all_tasks = 1; all_tasks = 1;
break; break;
case 'p': case 'p':
pid = strtol_or_err(argv[argc - 1], _("failed to parse pid")); pid = strtol_or_err(argv[argc - 1],
_("failed to parse pid"));
break; break;
case 'c': case 'c':
ts.use_list = 1; ts.use_list = 1;
break; break;
case 'V': case 'V':
printf("taskset (%s)\n", PACKAGE_STRING); printf("%s from %s\n", program_invocation_short_name,
PACKAGE_STRING);
return EXIT_SUCCESS; return EXIT_SUCCESS;
case 'h': case 'h':
usage(stdout); usage(stdout);