components/mc/patches/infopanel-cant-statvfs.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Fri, 15 Jan 2016 13:34:30 -0800
changeset 5289 255be830c2e5
parent 3561 8806d147c2d5
permissions -rw-r--r--
Close of build 91.

Upstream bugId: #3277
Synopsis: Info panel can't obtain file system statistics
Bug record: https://www.midnight-commander.org/ticket/3277

diff -Naur mc-4.8.13.old/src/filemanager/mountlist.c mc-4.8.13.new/src/filemanager/mountlist.c
--- mc-4.8.13.old/src/filemanager/mountlist.c	2014-09-02 11:23:58.000000000 +0200
+++ mc-4.8.13.new/src/filemanager/mountlist.c	2014-09-26 17:07:08.135044849 +0200
@@ -999,9 +999,9 @@
         char *table = MNTTAB;
         FILE *fp;
         int ret;
-        int lockfd;
 
 #if defined F_RDLCK && defined F_SETLKW
+        int lockfd;
         /* MNTTAB_LOCK is a macro name of our own invention; it's not present in
            e.g. Solaris 2.6.  If the SVR4 folks ever define a macro
            for this file name, we should use their macro name instead.
@@ -1056,8 +1056,10 @@
             ret = fclose (fp) == EOF ? errno : 0 < ret ? 0 : -1;
         }
 
+#if defined F_RDLCK && defined F_SETLKW
         if (lockfd >= 0 && close (lockfd) != 0)
             ret = errno;
+#endif
 
         if (ret >= 0)
         {