]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mount/fstab.c
nfs-utils: Fix source code character encoding
[nfs-utils.git] / utils / mount / fstab.c
index ec7ab528bac720ffa251a728960d3f9552caddad..051fa38c872503e37dfaca9e5c89c4ec4f2f7738 100644 (file)
@@ -1,4 +1,4 @@
-/* 1999-02-22 Arkadiusz MiΒΆkiewicz <misiek@pld.ORG.PL>
+/* 1999-02-22 Arkadiusz Miskiewicz <misiek@pld.ORG.PL>
  * - added Native Language Support
  * Sun Mar 21 1999 - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  * - fixed strerr(errno) in gettext calls
@@ -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 */