uml: helper.c warning corrections
authorVitaliy Ivanov <vitalivanov@gmail.com>
Tue, 26 Jul 2011 00:12:50 +0000 (17:12 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2011 03:57:13 +0000 (20:57 -0700)
Fix this warning:

  arch/um/os-Linux/helper.c: In function `helper_child':
  arch/um/os-Linux/helper.c:38:7: warning: ignoring return value of `write', declared with attribute warn_unused_result

[richard@nod.at: happens only with -D_FORTIFY_SOURCE=2]
Signed-off-by: Vitaliy Ivanov <vitalivanov@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/um/os-Linux/helper.c

index b6b1096152aac3f2e98b2da44aa3ea46a02cf4ba..feff22d64672d45c7652dcefdabf2278ba9e98e5 100644 (file)
@@ -28,14 +28,14 @@ static int helper_child(void *arg)
 {
        struct helper_data *data = arg;
        char **argv = data->argv;
-       int err;
+       int err, ret;
 
        if (data->pre_exec != NULL)
                (*data->pre_exec)(data->pre_data);
        err = execvp_noalloc(data->buf, argv[0], argv);
 
        /* If the exec succeeds, we don't get here */
-       write(data->fd, &err, sizeof(err));
+       CATCH_EINTR(ret = write(data->fd, &err, sizeof(err)));
 
        return 0;
 }