uml: cow_user.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/drivers/cow_user.c: In function `absolutize':
  arch/um/drivers/cow_user.c:189:7: warning: ignoring return value of `chdir', 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/drivers/cow_user.c

index 93f227a25ba42f5742d1343c1fc7e0bb34a9ea74..9cbb426c0b9183e8a5c65afe47483f47e00da0ec 100644 (file)
@@ -186,7 +186,11 @@ static int absolutize(char *to, int size, char *from)
                strcat(to, "/");
                strcat(to, from);
        }
-       chdir(save_cwd);
+       if (chdir(save_cwd)) {
+               cow_printf("absolutize : Can't cd to '%s' - "
+                          "errno = %d\n", save_cwd, errno);
+               return -1;
+       }
        return 0;
 }