diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/accounting/getdelays.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c index 795ca3911cc5..b11792abd6b6 100644 --- a/Documentation/accounting/getdelays.c +++ b/Documentation/accounting/getdelays.c | |||
@@ -285,7 +285,7 @@ int main(int argc, char *argv[]) | |||
285 | if (maskset) { | 285 | if (maskset) { |
286 | rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET, | 286 | rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET, |
287 | TASKSTATS_CMD_ATTR_REGISTER_CPUMASK, | 287 | TASKSTATS_CMD_ATTR_REGISTER_CPUMASK, |
288 | &cpumask, sizeof(cpumask)); | 288 | &cpumask, strlen(cpumask) + 1); |
289 | PRINTF("Sent register cpumask, retval %d\n", rc); | 289 | PRINTF("Sent register cpumask, retval %d\n", rc); |
290 | if (rc < 0) { | 290 | if (rc < 0) { |
291 | printf("error sending register cpumask\n"); | 291 | printf("error sending register cpumask\n"); |
@@ -315,7 +315,8 @@ int main(int argc, char *argv[]) | |||
315 | } | 315 | } |
316 | if (msg.n.nlmsg_type == NLMSG_ERROR || | 316 | if (msg.n.nlmsg_type == NLMSG_ERROR || |
317 | !NLMSG_OK((&msg.n), rep_len)) { | 317 | !NLMSG_OK((&msg.n), rep_len)) { |
318 | printf("fatal reply error, errno %d\n", errno); | 318 | struct nlmsgerr *err = NLMSG_DATA(&msg); |
319 | printf("fatal reply error, errno %d\n", err->error); | ||
319 | goto done; | 320 | goto done; |
320 | } | 321 | } |
321 | 322 | ||
@@ -383,7 +384,7 @@ done: | |||
383 | if (maskset) { | 384 | if (maskset) { |
384 | rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET, | 385 | rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET, |
385 | TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK, | 386 | TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK, |
386 | &cpumask, sizeof(cpumask)); | 387 | &cpumask, strlen(cpumask) + 1); |
387 | printf("Sent deregister mask, retval %d\n", rc); | 388 | printf("Sent deregister mask, retval %d\n", rc); |
388 | if (rc < 0) | 389 | if (rc < 0) |
389 | err(rc, "error sending deregister cpumask\n"); | 390 | err(rc, "error sending deregister cpumask\n"); |