OSDN Git Service

* path.cc (path_conv::check): Move fs-specific settings to a point where we
authorcgf <cgf>
Sun, 4 Jul 2010 17:12:26 +0000 (17:12 +0000)
committercgf <cgf>
Sun, 4 Jul 2010 17:12:26 +0000 (17:12 +0000)
know that we have filled out the filesystem information.
* path.h (path_conv::path_conv): Use consistent initialization for
constructors.
* include/sys/cygwin.h: Define CW_STRERROR.
* include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 228.
* include/external.h: Implement CW_STRERROR.

winsup/cygwin/ChangeLog
winsup/cygwin/external.cc
winsup/cygwin/include/cygwin/version.h
winsup/cygwin/include/sys/cygwin.h
winsup/cygwin/path.cc
winsup/cygwin/path.h

index cc7e9b3..4b697be 100644 (file)
@@ -1,3 +1,14 @@
+2010-07-04  Christopher Faylor  <me+cygwin@cgf.cx>
+
+       * path.cc (path_conv::check): Move fs-specific settings to a point
+       where we know that we have filled out the filesystem information.
+       * path.h (path_conv::path_conv): Use consistent initialization for
+       constructors.
+
+       * include/sys/cygwin.h: Define CW_STRERROR.
+       * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 228.
+       * include/external.h: Implement CW_STRERROR.
+
 2010-07-02  Corinna Vinschen  <corinna@vinschen.de>
 
        * net.cc (cygwin_getsockopt): Make sure SO_PEERCRED is only handled
index d760009..e01c9fe 100644 (file)
@@ -197,7 +197,7 @@ extern "C" unsigned long
 cygwin_internal (cygwin_getinfo_types t, ...)
 {
   va_list arg;
-  unsigned long res = -1;
+  uintptr_t res = (uintptr_t) -1;
   va_start (arg, t);
 
   switch (t)
@@ -508,6 +508,12 @@ cygwin_internal (cygwin_getinfo_types t, ...)
            }
        }
        break;
+      case CW_STRERROR:
+       {
+         int err = va_arg (arg, int);
+         res = (uintptr_t) strerror (err);
+       }
+       break;
 
       default:
        set_errno (ENOSYS);
index 08ffebc..3a95e51 100644 (file)
@@ -386,13 +386,14 @@ details. */
       224: Export xdr* functions.
       225: Export __xdr* functions.
       226: Export __locale_mb_cur_max.
-      227: Add pseudo_reloc_start, pseudo_reloc_end, image_base to per_process
+      227: Add pseudo_reloc_start, pseudo_reloc_end, image_base to per_process.
+      228: CW_STRERROR added.
      */
 
      /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
 
 #define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 227
+#define CYGWIN_VERSION_API_MINOR 228
 
      /* There is also a compatibity version number associated with the
        shared memory regions.  It is incremented when incompatible
index dcf61b0..d6df27d 100644 (file)
@@ -148,7 +148,8 @@ typedef enum
     CW_GET_INSTKEY,
     CW_INT_SETLOCALE,
     CW_CVT_MNT_OPTS,
-    CW_LST_MNT_OPTS
+    CW_LST_MNT_OPTS,
+    CW_STRERROR
   } cygwin_getinfo_types;
 
 /* Token type for CW_SET_EXTERNAL_TOKEN */
index dadbeca..dbdd8c4 100644 (file)
@@ -861,16 +861,6 @@ is_virtual_symlink:
            {
              fileattr = sym.fileattr;
              path_flags = sym.pflags;
-             /* If the FS has been found to have unrelibale inodes, note
-                that in path_flags. */
-             if (!fs.hasgood_inode ())
-               path_flags |= PATH_IHASH;
-             /* If the OS is caseinsensitive or the FS is caseinsensitive,
-                don't handle path casesensitive. */
-             if (cygwin_shared->obcaseinsensitive || fs.caseinsensitive ())
-               path_flags |= PATH_NOPOSIX;
-             caseinsensitive = (path_flags & PATH_NOPOSIX)
-                               ? OBJ_CASE_INSENSITIVE : 0;
            }
 
          /* If symlink.check found an existing non-symlink file, then
@@ -1057,6 +1047,16 @@ out:
                              but set it to not executable since it will be figured out
                              later by anything which cares about this. */
        }
+      /* If the FS has been found to have unrelibale inodes, note
+        that in path_flags. */
+      if (!fs.hasgood_inode ())
+       path_flags |= PATH_IHASH;
+      /* If the OS is caseinsensitive or the FS is caseinsensitive,
+        don't handle path casesensitive. */
+      if (cygwin_shared->obcaseinsensitive || fs.caseinsensitive ())
+       path_flags |= PATH_NOPOSIX;
+      caseinsensitive = (path_flags & PATH_NOPOSIX)
+                       ? OBJ_CASE_INSENSITIVE : 0;
       if (exec_state () != dont_know_if_executable)
        /* ok */;
       else if (isdir ())
index a2396f1..947e835 100644 (file)
@@ -207,21 +207,24 @@ class path_conv
 
   path_conv (int, const char *src, unsigned opt = PC_SYM_FOLLOW,
             const suffix_info *suffixes = NULL)
-  : wide_path (NULL), path (NULL), normalized_path (NULL)
+  : fileattr (INVALID_FILE_ATTRIBUTES), wide_path (NULL), path (NULL),
+    path_flags (0), known_suffix (NULL), normalized_path (NULL), error (0)
   {
     check (src, opt, suffixes);
   }
 
   path_conv (const UNICODE_STRING *src, unsigned opt = PC_SYM_FOLLOW,
             const suffix_info *suffixes = NULL)
-  : wide_path (NULL), path (NULL), normalized_path (NULL)
+  : fileattr (INVALID_FILE_ATTRIBUTES), wide_path (NULL), path (NULL),
+    path_flags (0), known_suffix (NULL), normalized_path (NULL), error (0)
   {
     check (src, opt | PC_NULLEMPTY, suffixes);
   }
 
   path_conv (const char *src, unsigned opt = PC_SYM_FOLLOW,
             const suffix_info *suffixes = NULL)
-  : wide_path (NULL), path (NULL), normalized_path (NULL)
+  : fileattr (INVALID_FILE_ATTRIBUTES), wide_path (NULL), path (NULL),
+    path_flags (0), known_suffix (NULL), normalized_path (NULL), error (0)
   {
     check (src, opt | PC_NULLEMPTY, suffixes);
   }