summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2010-07-04 17:12:27 +0000
committerChristopher Faylor <me@cgf.cx>2010-07-04 17:12:27 +0000
commit6259826eb42c86df34de98158c424060f98e3fa9 (patch)
tree271c6bcbe9f3d78330f46bd70109ffa0f332fef5
parentdaa71118088d9b09d0fce28df7d8b6deccb89d6a (diff)
downloadcygnal-6259826eb42c86df34de98158c424060f98e3fa9.tar.gz
cygnal-6259826eb42c86df34de98158c424060f98e3fa9.tar.bz2
cygnal-6259826eb42c86df34de98158c424060f98e3fa9.zip
* 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.
-rw-r--r--winsup/cygwin/ChangeLog11
-rw-r--r--winsup/cygwin/external.cc8
-rw-r--r--winsup/cygwin/include/cygwin/version.h5
-rw-r--r--winsup/cygwin/include/sys/cygwin.h3
-rw-r--r--winsup/cygwin/path.cc20
-rw-r--r--winsup/cygwin/path.h9
6 files changed, 39 insertions, 17 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index cc7e9b3ee..4b697be2c 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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
diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc
index d76000916..e01c9fea6 100644
--- a/winsup/cygwin/external.cc
+++ b/winsup/cygwin/external.cc
@@ -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);
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index 08ffebcf2..3a95e51e5 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -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
diff --git a/winsup/cygwin/include/sys/cygwin.h b/winsup/cygwin/include/sys/cygwin.h
index dcf61b081..d6df27df9 100644
--- a/winsup/cygwin/include/sys/cygwin.h
+++ b/winsup/cygwin/include/sys/cygwin.h
@@ -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 */
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index dadbeca4d..dbdd8c423 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -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 ())
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h
index a2396f1f7..947e83530 100644
--- a/winsup/cygwin/path.h
+++ b/winsup/cygwin/path.h
@@ -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);
}