mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-11 18:32:53 +03:00
Merge branch '3041_fix_cygwin_build'
* 3041_fix_cygwin_build: src/filemanager/mountlist.c: correct preprocessor conditions. Ticket #3041: fix build failure on Cygwin: redefinition of 'statvfs_works'.
This commit is contained in:
commit
909d3e0cc4
@ -98,18 +98,7 @@
|
||||
#define STRUCT_STATVFS struct statvfs
|
||||
#define STATFS statvfs
|
||||
|
||||
/* Return true if statvfs works. This is false for statvfs on systems
|
||||
with GNU libc on Linux kernels before 2.6.36, which stats all
|
||||
preceding entries in /proc/mounts; that makes df hang if even one
|
||||
of the corresponding file systems is hard-mounted but not available. */
|
||||
#if ! (__linux__ && (__GLIBC__ || __UCLIBC__))
|
||||
static int
|
||||
statvfs_works (void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
|
||||
#if __linux__ && (__GLIBC__ || __UCLIBC__)
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/statfs.h>
|
||||
#define STAT_STATFS2_BSIZE 1
|
||||
|
@ -179,6 +179,7 @@
|
||||
#endif
|
||||
|
||||
#include "lib/global.h"
|
||||
#include "lib/strutil.h" /* str_verscmp() */
|
||||
#include "mountlist.h"
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
@ -294,6 +295,7 @@ me_remote (char const *fs_name, char const *fs_type _GL_UNUSED)
|
||||
|
||||
#ifdef STAT_STATVFS
|
||||
#if ! (__linux__ && (__GLIBC__ || __UCLIBC__))
|
||||
/* The FRSIZE fallback is not required in this case. */
|
||||
#undef STAT_STATFS2_FRSIZE
|
||||
#else
|
||||
#include <sys/utsname.h>
|
||||
@ -313,8 +315,6 @@ me_remote (char const *fs_name, char const *fs_type _GL_UNUSED)
|
||||
#endif
|
||||
#endif /* STAT_READ_FILSYS */
|
||||
|
||||
#include "lib/strutil.h"
|
||||
|
||||
/*** file scope type declarations ****************************************************************/
|
||||
|
||||
/* A mount table entry. */
|
||||
@ -359,7 +359,6 @@ static int
|
||||
statvfs_works (void)
|
||||
{
|
||||
#if ! (__linux__ && (__GLIBC__ || __UCLIBC__))
|
||||
/* The FRSIZE fallback is not required in this case. */
|
||||
return 1;
|
||||
#else
|
||||
static int statvfs_works_cache = -1;
|
||||
@ -368,8 +367,8 @@ statvfs_works (void)
|
||||
if (statvfs_works_cache < 0)
|
||||
statvfs_works_cache = (uname (&name) == 0 && 0 <= str_verscmp (name.release, "2.6.36"));
|
||||
return statvfs_works_cache;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
Loading…
x
Reference in New Issue
Block a user