waitpid: Fix link error in C++ mode.
[pspp] / lib / mountlist.c
index 4672640ffe920c3e84d01e1a2da289e4ff8221c5..96e2b269f010e586bb6f325fa1d4cfb1d93d7a5b 100644 (file)
@@ -1,6 +1,6 @@
 /* mountlist.c -- return a list of mounted file systems
 
-   Copyright (C) 1991-1992, 1997-2009 Free Software Foundation, Inc.
+   Copyright (C) 1991-1992, 1997-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 #undef MNT_IGNORE
 #if defined MNTOPT_IGNORE && defined HAVE_HASMNTOPT
-# define MNT_IGNORE(M) hasmntopt ((M), MNTOPT_IGNORE)
+# define MNT_IGNORE(M) hasmntopt (M, MNTOPT_IGNORE)
 #else
 # define MNT_IGNORE(M) 0
 #endif
      || strcmp (Fs_type, "ignore") == 0)
 #endif
 
+#ifdef __CYGWIN__
+# include <windows.h>
+# define ME_REMOTE me_remote
+/* All cygwin mount points include `:' or start with `//'; so it
+   requires a native Windows call to determine remote disks.  */
+static bool
+me_remote (char const *fs_name, char const *fs_type _GL_UNUSED)
+{
+  if (fs_name[0] && fs_name[1] == ':')
+    {
+      char drive[4];
+      sprintf (drive, "%c:\\", fs_name[0]);
+      switch (GetDriveType (drive))
+        {
+        case DRIVE_REMOVABLE:
+        case DRIVE_FIXED:
+        case DRIVE_CDROM:
+        case DRIVE_RAMDISK:
+          return false;
+        }
+    }
+  return true;
+}
+#endif
+
 #ifndef ME_REMOTE
 /* A file system is `remote' if its Fs_name contains a `:'
    or if (it is of type (smbfs or cifs) and its Fs_name starts with `//').  */