X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Ffstab.c;h=2775d0bde95f596beb47677901d9248a10be2dee;hp=ec7ab528bac720ffa251a728960d3f9552caddad;hb=8414d150cee62ba0554cfd645956a88dba02a7eb;hpb=74fec59d7be4c993785bae386c10a0078e5b6d85 diff --git a/utils/mount/fstab.c b/utils/mount/fstab.c index ec7ab52..2775d0b 100644 --- a/utils/mount/fstab.c +++ b/utils/mount/fstab.c @@ -46,6 +46,11 @@ get_mtab_info(void) { } } +void +reset_mtab_info(void) { + have_mtab_info = 0; +} + int mtab_does_not_exist(void) { get_mtab_info(); @@ -280,7 +285,7 @@ handler (int sig) { } static void -setlkw_timeout (int sig) { +setlkw_timeout (__attribute__((unused)) int sig) { /* nothing, fcntl will fail anyway */ } @@ -541,8 +546,12 @@ update_mtab (const char *dir, struct mntent *instead) * from the present mtab before renaming. */ struct stat sbuf; - if (stat (MOUNTED, &sbuf) == 0) - chown (MOUNTED_TEMP, sbuf.st_uid, sbuf.st_gid); + if (stat (MOUNTED, &sbuf) == 0) { + if (chown (MOUNTED_TEMP, sbuf.st_uid, sbuf.st_gid) < 0) { + nfs_error(_("%s: error changing owner of %s: %s"), + progname, MOUNTED_TEMP, strerror (errno)); + } + } } /* rename mtemp to mtab */