Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2008-12-14 00:05:31 +0300
committerChristopher Faylor <me@cgf.cx>2008-12-14 00:05:31 +0300
commit9fe25af7a67193be17ccb58191694f504a805cf0 (patch)
tree569ac5bd2b7eea81c2b17ced60751b6d128f59e6
parenta1631dba6c9dfa4b64927d5e8750d6b65e84de8c (diff)
* cygheap.cc (cygheap_user::~cygheap_user): Remove unneeded if 0'ed code.
* fhandler_registry.cc (fhandler_registry::exists): Recode goto as if/else to avoid a gcc4 compiler warning. (fhandler_registry::open): Ditto. Use one goto rather than two. * gentls_offsets: Fix compiler warning in generated output. * tlsoffsets.h: Regenerate. * mount.cc (fillout_mntent): slashify native paths returned via getmntent.
-rw-r--r--winsup/cygwin/ChangeLog15
-rw-r--r--winsup/cygwin/cygheap.cc10
-rw-r--r--winsup/cygwin/fhandler_registry.cc174
-rwxr-xr-xwinsup/cygwin/gentls_offsets2
-rw-r--r--winsup/cygwin/mount.cc4
-rw-r--r--winsup/cygwin/tlsoffsets.h106
6 files changed, 158 insertions, 153 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 79ef6ac0a..c382e52ed 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,18 @@
+2008-12-13 Christopher Faylor <me+cygwin@cgf.cx>
+
+ * cygheap.cc (cygheap_user::~cygheap_user): Remove unneeded if 0'ed
+ code.
+
+ * fhandler_registry.cc (fhandler_registry::exists): Recode goto as
+ if/else to avoid a gcc4 compiler warning.
+ (fhandler_registry::open): Ditto. Use one goto rather than two.
+
+ * gentls_offsets: Fix compiler warning in generated output.
+ * tlsoffsets.h: Regenerate.
+
+ * mount.cc (fillout_mntent): slashify native paths returned via
+ getmntent.
+
2008-12-08 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* resolv.h: #include <netinet/in.h> for sockaddr_in typedef.
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index 635480adc..bddc6ce66 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -424,16 +424,6 @@ cygheap_root::set (const char *posix, const char *native, bool caseinsensitive)
cygheap_user::~cygheap_user ()
{
-#if 0
- if (pname)
- cfree (pname);
- if (plogsrv)
- cfree (plogsrv - 2);
- if (pdomain)
- cfree (pdomain);
- if (psid)
- cfree (psid);
-#endif
}
void
diff --git a/winsup/cygwin/fhandler_registry.cc b/winsup/cygwin/fhandler_registry.cc
index 4efe48e6f..63da374c8 100644
--- a/winsup/cygwin/fhandler_registry.cc
+++ b/winsup/cygwin/fhandler_registry.cc
@@ -147,7 +147,7 @@ decode_regname (char * dst, const char * src, int len = -1)
char *p;
c = strtoul (s, &p, 16);
if (!(must_encode (c) ||
- (c == '.' && si == 0 && (len == 3 || (src[3] == '.' && len == 4)))))
+ (c == '.' && si == 0 && (len == 3 || (src[3] == '.' && len == 4)))))
return -1;
dst[di++] = c;
si += 2;
@@ -237,72 +237,72 @@ fhandler_registry::exists ()
file++;
if (file == path)
- {
- for (int i = 0; registry_listing[i]; i++)
- if (path_prefix_p (registry_listing[i], path,
- strlen (registry_listing[i]), true))
- {
- file_type = 1;
- goto out;
- }
- goto out;
- }
-
- char dec_file[NAME_MAX + 1];
- int val_only = decode_regname (dec_file, file);
- if (val_only < 0)
- goto out;
-
- if (!val_only)
- hKey = open_key (path, KEY_READ, wow64, false);
- if (hKey != (HKEY) INVALID_HANDLE_VALUE)
- file_type = 1;
+ for (int i = 0; registry_listing[i]; i++)
+ if (path_prefix_p (registry_listing[i], path,
+ strlen (registry_listing[i]), true))
+ {
+ file_type = 1;
+ break;
+ }
else
{
- hKey = open_key (path, KEY_READ, wow64, true);
- if (hKey == (HKEY) INVALID_HANDLE_VALUE)
- return 0;
+ char dec_file[NAME_MAX + 1];
+
+ int val_only = decode_regname (dec_file, file);
+ if (val_only < 0)
+ goto out;
if (!val_only)
+ hKey = open_key (path, KEY_READ, wow64, false);
+ if (hKey != (HKEY) INVALID_HANDLE_VALUE)
+ file_type = 1;
+ else
{
+ hKey = open_key (path, KEY_READ, wow64, true);
+ if (hKey == (HKEY) INVALID_HANDLE_VALUE)
+ return 0;
+
+ if (!val_only)
+ {
+ while (ERROR_SUCCESS ==
+ (error = RegEnumKeyEx (hKey, index++, buf, &buf_size,
+ NULL, NULL, NULL, NULL))
+ || (error == ERROR_MORE_DATA))
+ {
+ if (strcasematch (buf, dec_file))
+ {
+ file_type = 1;
+ goto out;
+ }
+ buf_size = NAME_MAX + 1;
+ }
+ if (error != ERROR_NO_MORE_ITEMS)
+ {
+ seterrno_from_win_error (__FILE__, __LINE__, error);
+ goto out;
+ }
+ index = 0;
+ buf_size = NAME_MAX + 1;
+ }
+
while (ERROR_SUCCESS ==
- (error = RegEnumKeyEx (hKey, index++, buf, &buf_size,
- NULL, NULL, NULL, NULL))
+ (error = RegEnumValue (hKey, index++, buf, &buf_size, NULL, NULL,
+ NULL, NULL))
|| (error == ERROR_MORE_DATA))
{
- if (strcasematch (buf, dec_file))
+ if ( (buf[0] == '\0' && strcasematch (file, DEFAULT_VALUE_NAME))
+ || strcasematch (buf, dec_file))
{
- file_type = 1;
+ file_type = -1;
goto out;
}
- buf_size = NAME_MAX + 1;
+ buf_size = NAME_MAX + 1;
}
if (error != ERROR_NO_MORE_ITEMS)
{
seterrno_from_win_error (__FILE__, __LINE__, error);
goto out;
}
- index = 0;
- buf_size = NAME_MAX + 1;
- }
-
- while (ERROR_SUCCESS ==
- (error = RegEnumValue (hKey, index++, buf, &buf_size, NULL, NULL,
- NULL, NULL))
- || (error == ERROR_MORE_DATA))
- {
- if ( (buf[0] == '\0' && strcasematch (file, DEFAULT_VALUE_NAME))
- || strcasematch (buf, dec_file))
- {
- file_type = -1;
- goto out;
- }
- buf_size = NAME_MAX + 1;
- }
- if (error != ERROR_NO_MORE_ITEMS)
- {
- seterrno_from_win_error (__FILE__, __LINE__, error);
- goto out;
}
}
out:
@@ -649,64 +649,64 @@ fhandler_registry::open (int flags, mode_t mode)
{
set_errno (EROFS);
res = 0;
- goto out;
}
else
{
set_errno (ENOENT);
res = 0;
- goto out;
}
+ goto out;
}
if (flags & O_WRONLY)
{
set_errno (EROFS);
res = 0;
- goto out;
}
-
- char dec_file[NAME_MAX + 1];
- int val_only = decode_regname (dec_file, file);
- if (val_only < 0)
- {
- set_errno (EINVAL);
- res = 0;
- goto out;
- }
-
- if (!val_only)
- handle = open_key (path, KEY_READ, wow64, false);
- if (handle == (HKEY) INVALID_HANDLE_VALUE)
+ else
{
- handle = open_key (path, KEY_READ, wow64, true);
- if (handle == (HKEY) INVALID_HANDLE_VALUE)
+ char dec_file[NAME_MAX + 1];
+ int val_only = decode_regname (dec_file, file);
+ if (val_only < 0)
{
+ set_errno (EINVAL);
res = 0;
goto out;
}
- }
- else
- flags |= O_DIROPEN;
- set_io_handle (handle);
+ if (!val_only)
+ handle = open_key (path, KEY_READ, wow64, false);
+ if (handle == (HKEY) INVALID_HANDLE_VALUE)
+ {
+ handle = open_key (path, KEY_READ, wow64, true);
+ if (handle == (HKEY) INVALID_HANDLE_VALUE)
+ {
+ res = 0;
+ goto out;
+ }
+ }
+ else
+ flags |= O_DIROPEN;
- if (strcasematch (dec_file, DEFAULT_VALUE_NAME))
- value_name = cstrdup ("");
- else
- value_name = cstrdup (dec_file);
+ set_io_handle (handle);
- if (!(flags & O_DIROPEN) && !fill_filebuf ())
- {
- RegCloseKey (handle);
- res = 0;
- goto out;
- }
+ if (strcasematch (dec_file, DEFAULT_VALUE_NAME))
+ value_name = cstrdup ("");
+ else
+ value_name = cstrdup (dec_file);
- if (flags & O_APPEND)
- position = filesize;
- else
- position = 0;
+ if (!(flags & O_DIROPEN) && !fill_filebuf ())
+ {
+ RegCloseKey (handle);
+ res = 0;
+ goto out;
+ }
+
+ if (flags & O_APPEND)
+ position = filesize;
+ else
+ position = 0;
+ }
success:
res = 1;
@@ -834,7 +834,7 @@ open_key (const char *name, REGSAM access, DWORD wow64, bool isValue)
name++;
int val_only = decode_regname (component, anchor, name - anchor);
if (val_only < 0)
- {
+ {
set_errno (EINVAL);
if (parentOpened)
RegCloseKey (hParentKey);
diff --git a/winsup/cygwin/gentls_offsets b/winsup/cygwin/gentls_offsets
index 0ab6b64ab..2c96487d4 100755
--- a/winsup/cygwin/gentls_offsets
+++ b/winsup/cygwin/gentls_offsets
@@ -56,7 +56,7 @@ main(int argc, char **argv)
{
$struct *foo;
# define foo_beg ((char *) foo)
-# define offset(f) (-CYGTLS_PADSIZE + ((char *) &(foo->f)) - foo_beg)
+# define offset(f) ((int) (((char *) &(foo->f)) - foo_beg) - CYGTLS_PADSIZE)
# define poffset(f) (((char *) &(foo->f)) - ((char *) foo))
EOF
print TMP 'puts ("//;# autogenerated: Do not edit.\n");', "\n\n";
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
index 9ffdb8c1b..2768ce53c 100644
--- a/winsup/cygwin/mount.cc
+++ b/winsup/cygwin/mount.cc
@@ -1122,7 +1122,7 @@ fillout_mntent (const char *native_path, const char *posix_path, unsigned flags)
table because the mount table might change, causing weird effects
from the getmntent user's point of view. */
- strcpy (_my_tls.locals.mnt_fsname, native_path);
+ slashify (native_path, _my_tls.locals.mnt_fsname, false);
ret.mnt_fsname = _my_tls.locals.mnt_fsname;
strcpy (_my_tls.locals.mnt_dir, posix_path);
ret.mnt_dir = _my_tls.locals.mnt_dir;
@@ -1135,7 +1135,7 @@ fillout_mntent (const char *native_path, const char *posix_path, unsigned flags)
tmp_pathbuf tp;
UNICODE_STRING unat;
tp.u_get (&unat);
- get_nt_native_path (native_path, unat);
+ get_nt_native_path (_my_tls.locals.mnt_fsname, unat);
if (append_bs)
RtlAppendUnicodeToString (&unat, L"\\");
mntinfo.update (&unat, NULL);
diff --git a/winsup/cygwin/tlsoffsets.h b/winsup/cygwin/tlsoffsets.h
index 7c316518e..d147c82f4 100644
--- a/winsup/cygwin/tlsoffsets.h
+++ b/winsup/cygwin/tlsoffsets.h
@@ -1,6 +1,6 @@
//;# autogenerated: Do not edit.
-//; $tls::sizeof__cygtls = 4296;
+//; $tls::sizeof__cygtls = 4320;
//; $tls::func = -12700;
//; $tls::pfunc = 0;
//; $tls::el = -12696;
@@ -37,32 +37,32 @@
//; $tls::plocal_clib = 420;
//; $tls::__dontuse = -12280;
//; $tls::p__dontuse = 420;
-//; $tls::locals = -11216;
-//; $tls::plocals = 1484;
-//; $tls::_ctinfo = -9508;
-//; $tls::p_ctinfo = 3192;
-//; $tls::andreas = -9504;
-//; $tls::pandreas = 3196;
-//; $tls::wq = -9488;
-//; $tls::pwq = 3212;
-//; $tls::prev = -9460;
-//; $tls::pprev = 3240;
-//; $tls::next = -9456;
-//; $tls::pnext = 3244;
-//; $tls::sig = -9452;
-//; $tls::psig = 3248;
-//; $tls::incyg = -9448;
-//; $tls::pincyg = 3252;
-//; $tls::spinning = -9444;
-//; $tls::pspinning = 3256;
-//; $tls::stacklock = -9440;
-//; $tls::pstacklock = 3260;
-//; $tls::stackptr = -9436;
-//; $tls::pstackptr = 3264;
-//; $tls::stack = -9432;
-//; $tls::pstack = 3268;
-//; $tls::initialized = -8408;
-//; $tls::pinitialized = 4292;
+//; $tls::locals = -11192;
+//; $tls::plocals = 1508;
+//; $tls::_ctinfo = -9484;
+//; $tls::p_ctinfo = 3216;
+//; $tls::andreas = -9480;
+//; $tls::pandreas = 3220;
+//; $tls::wq = -9464;
+//; $tls::pwq = 3236;
+//; $tls::prev = -9436;
+//; $tls::pprev = 3264;
+//; $tls::next = -9432;
+//; $tls::pnext = 3268;
+//; $tls::sig = -9428;
+//; $tls::psig = 3272;
+//; $tls::incyg = -9424;
+//; $tls::pincyg = 3276;
+//; $tls::spinning = -9420;
+//; $tls::pspinning = 3280;
+//; $tls::stacklock = -9416;
+//; $tls::pstacklock = 3284;
+//; $tls::stackptr = -9412;
+//; $tls::pstackptr = 3288;
+//; $tls::stack = -9408;
+//; $tls::pstack = 3292;
+//; $tls::initialized = -8384;
+//; $tls::pinitialized = 4316;
//; __DATA__
#define tls_func (-12700)
@@ -101,29 +101,29 @@
#define tls_plocal_clib (420)
#define tls___dontuse (-12280)
#define tls_p__dontuse (420)
-#define tls_locals (-11216)
-#define tls_plocals (1484)
-#define tls__ctinfo (-9508)
-#define tls_p_ctinfo (3192)
-#define tls_andreas (-9504)
-#define tls_pandreas (3196)
-#define tls_wq (-9488)
-#define tls_pwq (3212)
-#define tls_prev (-9460)
-#define tls_pprev (3240)
-#define tls_next (-9456)
-#define tls_pnext (3244)
-#define tls_sig (-9452)
-#define tls_psig (3248)
-#define tls_incyg (-9448)
-#define tls_pincyg (3252)
-#define tls_spinning (-9444)
-#define tls_pspinning (3256)
-#define tls_stacklock (-9440)
-#define tls_pstacklock (3260)
-#define tls_stackptr (-9436)
-#define tls_pstackptr (3264)
-#define tls_stack (-9432)
-#define tls_pstack (3268)
-#define tls_initialized (-8408)
-#define tls_pinitialized (4292)
+#define tls_locals (-11192)
+#define tls_plocals (1508)
+#define tls__ctinfo (-9484)
+#define tls_p_ctinfo (3216)
+#define tls_andreas (-9480)
+#define tls_pandreas (3220)
+#define tls_wq (-9464)
+#define tls_pwq (3236)
+#define tls_prev (-9436)
+#define tls_pprev (3264)
+#define tls_next (-9432)
+#define tls_pnext (3268)
+#define tls_sig (-9428)
+#define tls_psig (3272)
+#define tls_incyg (-9424)
+#define tls_pincyg (3276)
+#define tls_spinning (-9420)
+#define tls_pspinning (3280)
+#define tls_stacklock (-9416)
+#define tls_pstacklock (3284)
+#define tls_stackptr (-9412)
+#define tls_pstackptr (3288)
+#define tls_stack (-9408)
+#define tls_pstack (3292)
+#define tls_initialized (-8384)
+#define tls_pinitialized (4316)