* 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.
This commit is contained in:
Christopher Faylor 2008-12-13 21:05:31 +00:00
parent a1631dba6c
commit 9fe25af7a6
6 changed files with 160 additions and 155 deletions

View File

@ -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> 2008-12-08 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* resolv.h: #include <netinet/in.h> for sockaddr_in typedef. * resolv.h: #include <netinet/in.h> for sockaddr_in typedef.

View File

@ -424,16 +424,6 @@ cygheap_root::set (const char *posix, const char *native, bool caseinsensitive)
cygheap_user::~cygheap_user () 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 void

View File

@ -237,18 +237,17 @@ fhandler_registry::exists ()
file++; file++;
if (file == path) if (file == path)
{
for (int i = 0; registry_listing[i]; i++) for (int i = 0; registry_listing[i]; i++)
if (path_prefix_p (registry_listing[i], path, if (path_prefix_p (registry_listing[i], path,
strlen (registry_listing[i]), true)) strlen (registry_listing[i]), true))
{ {
file_type = 1; file_type = 1;
goto out; break;
} }
goto out; else
} {
char dec_file[NAME_MAX + 1]; char dec_file[NAME_MAX + 1];
int val_only = decode_regname (dec_file, file); int val_only = decode_regname (dec_file, file);
if (val_only < 0) if (val_only < 0)
goto out; goto out;
@ -305,6 +304,7 @@ fhandler_registry::exists ()
goto out; goto out;
} }
} }
}
out: out:
if (hKey != (HKEY) INVALID_HANDLE_VALUE) if (hKey != (HKEY) INVALID_HANDLE_VALUE)
RegCloseKey (hKey); RegCloseKey (hKey);
@ -649,23 +649,22 @@ fhandler_registry::open (int flags, mode_t mode)
{ {
set_errno (EROFS); set_errno (EROFS);
res = 0; res = 0;
goto out;
} }
else else
{ {
set_errno (ENOENT); set_errno (ENOENT);
res = 0; res = 0;
goto out;
} }
goto out;
} }
if (flags & O_WRONLY) if (flags & O_WRONLY)
{ {
set_errno (EROFS); set_errno (EROFS);
res = 0; res = 0;
goto out;
} }
else
{
char dec_file[NAME_MAX + 1]; char dec_file[NAME_MAX + 1];
int val_only = decode_regname (dec_file, file); int val_only = decode_regname (dec_file, file);
if (val_only < 0) if (val_only < 0)
@ -707,6 +706,7 @@ fhandler_registry::open (int flags, mode_t mode)
position = filesize; position = filesize;
else else
position = 0; position = 0;
}
success: success:
res = 1; res = 1;

View File

@ -56,7 +56,7 @@ main(int argc, char **argv)
{ {
$struct *foo; $struct *foo;
# define foo_beg ((char *) 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)) # define poffset(f) (((char *) &(foo->f)) - ((char *) foo))
EOF EOF
print TMP 'puts ("//;# autogenerated: Do not edit.\n");', "\n\n"; print TMP 'puts ("//;# autogenerated: Do not edit.\n");', "\n\n";

View File

@ -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 table because the mount table might change, causing weird effects
from the getmntent user's point of view. */ 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; ret.mnt_fsname = _my_tls.locals.mnt_fsname;
strcpy (_my_tls.locals.mnt_dir, posix_path); strcpy (_my_tls.locals.mnt_dir, posix_path);
ret.mnt_dir = _my_tls.locals.mnt_dir; 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; tmp_pathbuf tp;
UNICODE_STRING unat; UNICODE_STRING unat;
tp.u_get (&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) if (append_bs)
RtlAppendUnicodeToString (&unat, L"\\"); RtlAppendUnicodeToString (&unat, L"\\");
mntinfo.update (&unat, NULL); mntinfo.update (&unat, NULL);

View File

@ -1,6 +1,6 @@
//;# autogenerated: Do not edit. //;# autogenerated: Do not edit.
//; $tls::sizeof__cygtls = 4296; //; $tls::sizeof__cygtls = 4320;
//; $tls::func = -12700; //; $tls::func = -12700;
//; $tls::pfunc = 0; //; $tls::pfunc = 0;
//; $tls::el = -12696; //; $tls::el = -12696;
@ -37,32 +37,32 @@
//; $tls::plocal_clib = 420; //; $tls::plocal_clib = 420;
//; $tls::__dontuse = -12280; //; $tls::__dontuse = -12280;
//; $tls::p__dontuse = 420; //; $tls::p__dontuse = 420;
//; $tls::locals = -11216; //; $tls::locals = -11192;
//; $tls::plocals = 1484; //; $tls::plocals = 1508;
//; $tls::_ctinfo = -9508; //; $tls::_ctinfo = -9484;
//; $tls::p_ctinfo = 3192; //; $tls::p_ctinfo = 3216;
//; $tls::andreas = -9504; //; $tls::andreas = -9480;
//; $tls::pandreas = 3196; //; $tls::pandreas = 3220;
//; $tls::wq = -9488; //; $tls::wq = -9464;
//; $tls::pwq = 3212; //; $tls::pwq = 3236;
//; $tls::prev = -9460; //; $tls::prev = -9436;
//; $tls::pprev = 3240; //; $tls::pprev = 3264;
//; $tls::next = -9456; //; $tls::next = -9432;
//; $tls::pnext = 3244; //; $tls::pnext = 3268;
//; $tls::sig = -9452; //; $tls::sig = -9428;
//; $tls::psig = 3248; //; $tls::psig = 3272;
//; $tls::incyg = -9448; //; $tls::incyg = -9424;
//; $tls::pincyg = 3252; //; $tls::pincyg = 3276;
//; $tls::spinning = -9444; //; $tls::spinning = -9420;
//; $tls::pspinning = 3256; //; $tls::pspinning = 3280;
//; $tls::stacklock = -9440; //; $tls::stacklock = -9416;
//; $tls::pstacklock = 3260; //; $tls::pstacklock = 3284;
//; $tls::stackptr = -9436; //; $tls::stackptr = -9412;
//; $tls::pstackptr = 3264; //; $tls::pstackptr = 3288;
//; $tls::stack = -9432; //; $tls::stack = -9408;
//; $tls::pstack = 3268; //; $tls::pstack = 3292;
//; $tls::initialized = -8408; //; $tls::initialized = -8384;
//; $tls::pinitialized = 4292; //; $tls::pinitialized = 4316;
//; __DATA__ //; __DATA__
#define tls_func (-12700) #define tls_func (-12700)
@ -101,29 +101,29 @@
#define tls_plocal_clib (420) #define tls_plocal_clib (420)
#define tls___dontuse (-12280) #define tls___dontuse (-12280)
#define tls_p__dontuse (420) #define tls_p__dontuse (420)
#define tls_locals (-11216) #define tls_locals (-11192)
#define tls_plocals (1484) #define tls_plocals (1508)
#define tls__ctinfo (-9508) #define tls__ctinfo (-9484)
#define tls_p_ctinfo (3192) #define tls_p_ctinfo (3216)
#define tls_andreas (-9504) #define tls_andreas (-9480)
#define tls_pandreas (3196) #define tls_pandreas (3220)
#define tls_wq (-9488) #define tls_wq (-9464)
#define tls_pwq (3212) #define tls_pwq (3236)
#define tls_prev (-9460) #define tls_prev (-9436)
#define tls_pprev (3240) #define tls_pprev (3264)
#define tls_next (-9456) #define tls_next (-9432)
#define tls_pnext (3244) #define tls_pnext (3268)
#define tls_sig (-9452) #define tls_sig (-9428)
#define tls_psig (3248) #define tls_psig (3272)
#define tls_incyg (-9448) #define tls_incyg (-9424)
#define tls_pincyg (3252) #define tls_pincyg (3276)
#define tls_spinning (-9444) #define tls_spinning (-9420)
#define tls_pspinning (3256) #define tls_pspinning (3280)
#define tls_stacklock (-9440) #define tls_stacklock (-9416)
#define tls_pstacklock (3260) #define tls_pstacklock (3284)
#define tls_stackptr (-9436) #define tls_stackptr (-9412)
#define tls_pstackptr (3264) #define tls_pstackptr (3288)
#define tls_stack (-9432) #define tls_stack (-9408)
#define tls_pstack (3268) #define tls_pstack (3292)
#define tls_initialized (-8408) #define tls_initialized (-8384)
#define tls_pinitialized (4292) #define tls_pinitialized (4316)