From 2cbdba0c5c13e453afcc6fa4ad830785ee26fc57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Mon, 9 Sep 2013 15:39:45 +0200 Subject: [PATCH] Silenced warnings by gcc >= 4.8 about non-checked return values Added tests on the value returned by setuid() to avoid warnings by gcc >= 4.8 --- libfuse-lite/mount_util.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libfuse-lite/mount_util.c b/libfuse-lite/mount_util.c index 724a042d..1a7ac3c7 100644 --- a/libfuse-lite/mount_util.c +++ b/libfuse-lite/mount_util.c @@ -305,7 +305,9 @@ int fuse_mnt_add_mount(const char *progname, const char *fsname, char templ[] = "/tmp/fusermountXXXXXX"; char *tmp; - setuid(geteuid()); + if (setuid(geteuid())) + fprintf(stderr, "%s: failed to setuid : %s\n", progname, + strerror(errno)); /* * hide in a directory, where mount isn't able to resolve @@ -351,7 +353,9 @@ int fuse_mnt_umount(const char *progname, const char *mnt, int lazy) return -1; } if (res == 0) { - setuid(geteuid()); + if (setuid(geteuid())) + fprintf(stderr, "%s: failed to setuid : %s\n", progname, + strerror(errno)); execl("/bin/umount", "/bin/umount", "-i", mnt, lazy ? "-l" : NULL, NULL); fprintf(stderr, "%s: failed to execute /bin/umount: %s\n", progname,