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
This commit is contained in:
Jean-Pierre André 2013-09-09 15:39:45 +02:00
parent 5e18e97d0b
commit 2cbdba0c5c

View File

@ -305,7 +305,9 @@ int fuse_mnt_add_mount(const char *progname, const char *fsname,
char templ[] = "/tmp/fusermountXXXXXX"; char templ[] = "/tmp/fusermountXXXXXX";
char *tmp; 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 * 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; return -1;
} }
if (res == 0) { 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, execl("/bin/umount", "/bin/umount", "-i", mnt, lazy ? "-l" : NULL,
NULL); NULL);
fprintf(stderr, "%s: failed to execute /bin/umount: %s\n", progname, fprintf(stderr, "%s: failed to execute /bin/umount: %s\n", progname,