diff options
author | Christopher Faylor <me@cgf.cx> | 2009-01-09 05:18:02 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2009-01-09 05:18:02 +0000 |
commit | d95d8c5393988702112b8fcd154683150227cb7a (patch) | |
tree | 68eae25a4f9469fae8cbc227f8b4ca28e11c57e5 | |
parent | 086dc27fec1b3e5ff4e01404b67e02d745f01d4b (diff) | |
download | newlib-d95d8c5393988702112b8fcd154683150227cb7a.zip newlib-d95d8c5393988702112b8fcd154683150227cb7a.tar.gz newlib-d95d8c5393988702112b8fcd154683150227cb7a.tar.bz2 |
* include/sys/cygwin.h (CW_SETERRNO): Define.
* external.cc (CW_SETERRNO): Implement.
* include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 192 to reflect the
above change.
* path.cc (path_prefix_p): Treat X: as equivalent to x:.
* mkglobals_h: Remove unneeded #define.
* spawn.cc (spawn_guts): Avoid overly wordy initialization to zero.
-rw-r--r-- | winsup/cygwin/ChangeLog | 13 | ||||
-rw-r--r-- | winsup/cygwin/external.cc | 7 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/version.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/include/sys/cygwin.h | 3 | ||||
-rwxr-xr-x | winsup/cygwin/mkglobals_h | 1 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 16 | ||||
-rw-r--r-- | winsup/cygwin/spawn.cc | 3 |
7 files changed, 39 insertions, 7 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 46eddfa..a2c604c 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,16 @@ +2009-01-09 Christopher Faylor <me+cygwin@cgf.cx> + + * include/sys/cygwin.h (CW_SETERRNO): Define. + * external.cc (CW_SETERRNO): Implement. + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 192 to + reflect the above change. + + * path.cc (path_prefix_p): Treat X: as equivalent to x:. + + * mkglobals_h: Remove unneeded #define. + + * spawn.cc (spawn_guts): Avoid overly wordy initialization to zero. + 2009-01-08 Corinna Vinschen <corinna@vinschen.de> * libc/fts.c (fts_build): Use DT_DIR case on Cygwin. diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index b880e07..0157fc0 100644 --- a/winsup/cygwin/external.cc +++ b/winsup/cygwin/external.cc @@ -363,6 +363,13 @@ cygwin_internal (cygwin_getinfo_types t, ...) const char *passwd = va_arg (arg, const char *); return setlsapwd (passwd); } + case CW_SETERRNO: + { + const char *file = va_arg (arg, const char *); + int line = va_arg (arg, int); + seterrno(file, line); + } + break; default: break; diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index b919e1c..2de3d49 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -340,12 +340,13 @@ details. */ 190: Export fgetwc, fgetws, fputwc, fputws, fwide, getwc, getwchar, putwc, putwchar, ungetwc. 191: Export glob_pattern_p + 192: CW_SETERRNO added */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 191 +#define CYGWIN_VERSION_API_MINOR 192 /* 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 8c11010..7ad0bcd 100644 --- a/winsup/cygwin/include/sys/cygwin.h +++ b/winsup/cygwin/include/sys/cygwin.h @@ -141,7 +141,8 @@ typedef enum CW_SYNC_WINENV, CW_CYGTLS_PADSIZE, CW_SET_DOS_FILE_WARNING, - CW_SET_PRIV_KEY + CW_SET_PRIV_KEY, + CW_SETERRNO } cygwin_getinfo_types; #define CW_NEXTPID 0x80000000 /* or with pid to get next one */ diff --git a/winsup/cygwin/mkglobals_h b/winsup/cygwin/mkglobals_h index 61cfef3..1e409e0 100755 --- a/winsup/cygwin/mkglobals_h +++ b/winsup/cygwin/mkglobals_h @@ -18,7 +18,6 @@ print <<PRELUDE,$_,"#endif /*_GLOBALS_H*/\n"; /* $target - Autogenerated from @argv. Look there for comments. */ #ifndef _GLOBALS_H -#define _GLOBALS_H 1 PRELUDE close $target_fd; sub munge($) { diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index da96cde..f736be4 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -169,8 +169,20 @@ path_prefix_p (const char *path1, const char *path2, int len1, return isdirsep (path2[0]) && !isdirsep (path2[1]); if (isdirsep (path2[len1]) || path2[len1] == 0 || path1[len1 - 1] == ':') - return caseinsensitive ? strncasematch (path1, path2, len1) - : !strncmp (path1, path2, len1); + { + if (len1 < 2 || (path1[1] != ':') || (path2[1] != ':')) + /* nothing */; + else if (tolower (*path1) != tolower(*path2)) + return 0; + else + { + path1 += 2; + path2 += 2; + len1 -= 2; + } + return caseinsensitive ? strncasematch (path1, path2, len1) + : !strncmp (path1, path2, len1); + } return 0; } diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index bb8a75f..121655d 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -310,8 +310,7 @@ spawn_guts (const char *prog_arg, const char *const *argv, cygheap_exec_info *moreinfo; bool null_app_name = false; - STARTUPINFOW si = {0, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, - NULL, NULL, NULL}; + STARTUPINFOW si = {}; int looped = 0; HANDLE orig_wr_proc_pipe = NULL; |