white space and minor comment cleanup.

This commit is contained in:
Christopher Faylor 2005-05-02 03:50:11 +00:00
parent b9b1b38358
commit 05726ddd86
40 changed files with 265 additions and 265 deletions

View File

@ -54,14 +54,14 @@ Fri Dec 13 16:18:22 1996 Jeremy Allison <jra@cygnus.com>
Fri Dec 13 10:56:21 1996 Jeremy Allison <jra@cygnus.com> Fri Dec 13 10:56:21 1996 Jeremy Allison <jra@cygnus.com>
* cygwin.din: Added h_errno, seteuid, _seteuid. * cygwin.din: Added h_errno, seteuid, _seteuid.
* exceptions.cc: Made init_exceptions extern "C". * exceptions.cc: Made init_exceptions extern "C".
* exceptions.h: Added cplusplus wrappers to enable this to * exceptions.h: Added cplusplus wrappers to enable this to
be used from C. be used from C.
* net.cc: Added error numbers, fixed gethostbyaddr, added h_errno * net.cc: Added error numbers, fixed gethostbyaddr, added h_errno
fixes. fixes.
* stubs.cc: Added seteuid. * stubs.cc: Added seteuid.
* include/mywinsock.h: Added HOST error entries for DNS lookups. * include/mywinsock.h: Added HOST error entries for DNS lookups.
Tue Dec 10 15:38:46 1996 Geoffrey Noer <noer@cygnus.com> Tue Dec 10 15:38:46 1996 Geoffrey Noer <noer@cygnus.com>
@ -75,7 +75,7 @@ Tue Dec 10 15:38:46 1996 Geoffrey Noer <noer@cygnus.com>
Thu Dec 5 14:03:08 1996 Geoffrey Noer <noer@cygnus.com> Thu Dec 5 14:03:08 1996 Geoffrey Noer <noer@cygnus.com>
* select.cc: add missing end comment at about line 933. * select.cc: add missing end comment at about line 933.
gnu-win32 beta 17 release made gnu-win32 beta 17 release made
Wed Dec 4 15:53:11 1996 Geoffrey Noer <noer@cygnus.com> Wed Dec 4 15:53:11 1996 Geoffrey Noer <noer@cygnus.com>
@ -293,19 +293,19 @@ Wed Oct 30 16:35:41 1996 Jeremy Allison <jra@cygnus.com>
Wed Oct 30 13:05:33 1996 Geoffrey Noer <noer@cygnus.com> Wed Oct 30 13:05:33 1996 Geoffrey Noer <noer@cygnus.com>
* include/custcntl.h * include/custcntl.h
* include/features.h * include/features.h
* include/icmp.h * include/icmp.h
* include/wchar.h * include/wchar.h
* include/cygwin32/icmp.h * include/cygwin32/icmp.h
* include/cygwin32/ip.h * include/cygwin32/ip.h
* include/cygwin32/sockios.h * include/cygwin32/sockios.h
* include/cygwin32/types.h * include/cygwin32/types.h
* include/cygwin32/uio.h * include/cygwin32/uio.h
* include/sys/ttychars.h * include/sys/ttychars.h
Added comment with name of header to each so that these are no Added comment with name of header to each so that these are no
longer empty files (some unzip programs won't create longer empty files (some unzip programs won't create
zero-length files which is a problem for headers) zero-length files which is a problem for headers)
Sun Oct 27 17:30:03 1996 Geoffrey Noer <noer@cygnus.com> Sun Oct 27 17:30:03 1996 Geoffrey Noer <noer@cygnus.com>
@ -407,11 +407,11 @@ Mon Oct 21 09:48:00 1996 Jeremy Allison <jra@cygnus.com>
* select.cc: Re-written from scratch. Take account of * select.cc: Re-written from scratch. Take account of
the following cases. (1). All sockets [written&works] the following cases. (1). All sockets [written&works]
(2). Handles, sockets and always readies [written,not tested] (2). Handles, sockets and always readies [written,not tested]
(3). All handles [written,not tested]. (4). Handles & sockets (3). All handles [written,not tested]. (4). Handles & sockets
with timeout [not yet written,returns -1]. Correctly blocks with timeout [not yet written,returns -1]. Correctly blocks
and doesn't spin cpu. and doesn't spin cpu.
* pinfo.cc: Changed to add global lock around pinfo array. * pinfo.cc: Changed to add global lock around pinfo array.
* fork.cc: Changed to use global pinfo lock. * fork.cc: Changed to use global pinfo lock.
* shared.cc: Fixed bug with fork()->exec()->exec() code. * shared.cc: Fixed bug with fork()->exec()->exec() code.
* net.cc: Removed select_init() call (no longer used). * net.cc: Removed select_init() call (no longer used).
@ -478,19 +478,19 @@ Wed Oct 16 17:16:33 1996 Geoffrey Noer <noer@cygnus.com>
Tue Oct 15 09:51:48 1996 Jeremy Allison <jra@cygnus.com> Tue Oct 15 09:51:48 1996 Jeremy Allison <jra@cygnus.com>
* fhandler.h: Many changes to support moving fhandler array out of * fhandler.h: Many changes to support moving fhandler array out of
shared area into locally allocated memory. Removed fhandler class, shared area into locally allocated memory. Removed fhandler class,
fhandler_base is now root of class tree. Re-arranged class definitions fhandler_base is now root of class tree. Re-arranged class definitions
to make it clear what functions are virtual and can be overridden. to make it clear what functions are virtual and can be overridden.
Inlined may accessor functions. Inlined may accessor functions.
* fhandler.cc: Many changes to support moving fhandler array out of * fhandler.cc: Many changes to support moving fhandler array out of
shared area into locally allocated memory. unix_path_name_ is now shared area into locally allocated memory. unix_path_name_ is now
always set (all fhandler_base classes have a name). always set (all fhandler_base classes have a name).
* hinfo.cc: Many changes to support moving fhandler array out of * hinfo.cc: Many changes to support moving fhandler array out of
shared area into locally allocated memory. Added linearization and shared area into locally allocated memory. Added linearization and
de-linearization functions. de-linearization functions.
* net.cc(socket): Added code to keep name for fhandler_socket. * net.cc(socket): Added code to keep name for fhandler_socket.
* pinfo.cc : Changed allocation of fhandler_base array to be in local * pinfo.cc : Changed allocation of fhandler_base array to be in local
memory rather than in shared area. (modified functions are pinfo_init, memory rather than in shared area. (modified functions are pinfo_init,
pinfo_list::get_empty_pinfo, pinfo_list::allocate_pid, pinfo_list::get_empty_pinfo, pinfo_list::allocate_pid,
pinfo::record_death). pinfo::record_death).
* shared.cc: Added functions to copy fd area for spawned process. * shared.cc: Added functions to copy fd area for spawned process.
@ -511,13 +511,13 @@ Tue Oct 15 09:51:48 1996 Jeremy Allison <jra@cygnus.com>
Mon Oct 14 14:59:16 1996 Geoffrey Noer <noer@cygnus.com> Mon Oct 14 14:59:16 1996 Geoffrey Noer <noer@cygnus.com>
* sysdef/i386: replace all files with ones from Scott * sysdef/i386: replace all files with ones from Scott
Christley's windows32api-0.1.2 package. Still need to Christley's windows32api-0.1.2 package. Still need to
integrate new headers. integrate new headers.
Mon Oct 14 13:41:14 1996 Geoffrey Noer <noer@cygnus.com> Mon Oct 14 13:41:14 1996 Geoffrey Noer <noer@cygnus.com>
* syscalls.cc (_unlink): need to fchmod file to writable * syscalls.cc (_unlink): need to fchmod file to writable
before attempting to delete. This change still needs more before attempting to delete. This change still needs more
work (fchmod isn't written yet). work (fchmod isn't written yet).
* (fchmod): change comment * (fchmod): change comment
@ -567,7 +567,7 @@ Thu Oct 3 16:19:23 1996 Jeremy Allison <jra@cygnus.com>
and understanding which variables are class variables much simpler. and understanding which variables are class variables much simpler.
Changed name member to unix_path_name_ and made dynamic rather Changed name member to unix_path_name_ and made dynamic rather
than a fixed 31 byte buffer per entry. than a fixed 31 byte buffer per entry.
* fhandler.cc: Updated varable access for above. * fhandler.cc: Updated varable access for above.
* fcntl.cc: Updated varable access for above. * fcntl.cc: Updated varable access for above.
* hinfo.cc: Updated varable access for above. * hinfo.cc: Updated varable access for above.
* spawn.cc: Updated varable access for above. * spawn.cc: Updated varable access for above.
@ -793,10 +793,10 @@ Thu Aug 22 01:36:53 1996 Geoffrey Noer <noer@cygnus.com>
Wed Aug 21 16:15:47 1996 Geoffrey Noer <noer@cygnus.com> Wed Aug 21 16:15:47 1996 Geoffrey Noer <noer@cygnus.com>
* cygwin.din: list vfork * cygwin.din: list vfork
* dirsearch.cc: fix errno setting in readdir that caused * dirsearch.cc: fix errno setting in readdir that caused
diff to not function on directories diff to not function on directories
* pipe.cc: reformatted * pipe.cc: reformatted
Wed Aug 21 15:12:47 1996 Jeremy Allison <jra@cygnus.com> Wed Aug 21 15:12:47 1996 Jeremy Allison <jra@cygnus.com>
@ -870,8 +870,8 @@ Sat Aug 10 16:30:14 1996 Geoffrey Noer <noer@cygnus.com>
Fri Aug 9 18:19:12 1996 Geoffrey Noer <noer@cygnus.com> Fri Aug 9 18:19:12 1996 Geoffrey Noer <noer@cygnus.com>
* syscalls.cc (_rename): return -1 if file to be renamed * syscalls.cc (_rename): return -1 if file to be renamed
doesn't exist. Reformatted whole file. doesn't exist. Reformatted whole file.
* fork.cc: increase timeout value to 60 sec from 30 sec * fork.cc: increase timeout value to 60 sec from 30 sec
Thu Aug 8 17:44:39 1996 Jim Wilson <wilson@cygnus.com> Thu Aug 8 17:44:39 1996 Jim Wilson <wilson@cygnus.com>
@ -1639,16 +1639,16 @@ Mon May 13 13:45:36 1996 Mark Eichin <eichin@cygnus.com>
Fri May 10 17:59:09 1996 Mark Eichin <eichin@cygnus.com> Fri May 10 17:59:09 1996 Mark Eichin <eichin@cygnus.com>
* select.cc: change most debugging statements to select_printf. * select.cc: change most debugging statements to select_printf.
(dbg_input_event): new function, prints an INPUT_RECORD via select (dbg_input_event): new function, prints an INPUT_RECORD via select
printf. printf.
(polled): Don't sleep around WaitForMultipleObjects; let it have a (polled): Don't sleep around WaitForMultipleObjects; let it have a
10ms timeout until we have time to test it with 0. If 10ms timeout until we have time to test it with 0. If
WaitForMultipleObjects says that STD_INPUT_HANDLE has data, use WaitForMultipleObjects says that STD_INPUT_HANDLE has data, use
PeekConsoleInput to scan the available events. If the first one is PeekConsoleInput to scan the available events. If the first one is
not a *bKeyDown* with a non-zero *AsciiChar* then use not a *bKeyDown* with a non-zero *AsciiChar* then use
ReadConsoleInput to rip it off the queue, and pretend it wasn't ReadConsoleInput to rip it off the queue, and pretend it wasn't
there, so that later calls to read (and thus ReadFile) don't block there, so that later calls to read (and thus ReadFile) don't block
because they can't find any *real* input. (This could be optimized because they can't find any *real* input. (This could be optimized
later to check the whole queue, and if there are *no* real input later to check the whole queue, and if there are *no* real input
events, nuke them all.) events, nuke them all.)
@ -1656,11 +1656,11 @@ Fri May 10 17:59:09 1996 Mark Eichin <eichin@cygnus.com>
category, because select needs a *lot* of work. STRACE=256 to use it. category, because select needs a *lot* of work. STRACE=256 to use it.
* fhandler.cc (fhandler_console_in::init): IGNCR can't work * fhandler.cc (fhandler_console_in::init): IGNCR can't work
without major changes to deal with the interaction with select without major changes to deal with the interaction with select
(which shouldn't wake up if IGNCR causes the whole input to be (which shouldn't wake up if IGNCR causes the whole input to be
deleted...) so don't make it the default. deleted...) so don't make it the default.
(fhandler_console_out::tcgetattr, fhandler_tty::tcgetattr): don't (fhandler_console_out::tcgetattr, fhandler_tty::tcgetattr): don't
set IGNCR based on get_r_binary either. set IGNCR based on get_r_binary either.
Wed May 8 20:20:05 1996 Mark Eichin <eichin@cygnus.com> Wed May 8 20:20:05 1996 Mark Eichin <eichin@cygnus.com>

View File

@ -2659,10 +2659,10 @@ Fri Feb 14 18:55:01 1997 Jeremy Allison <jra@cygnus.com>
Thu Feb 13 14:06:04 1997 Geoffrey Noer <noer@cygnus.com> Thu Feb 13 14:06:04 1997 Geoffrey Noer <noer@cygnus.com>
* path.cc: remove SLASH_P define and * path.cc: remove SLASH_P define and
* winsup.h: define it here instead * winsup.h: define it here instead
patch from scottk@utig.ig.utexas.edu (Scott Kempf): patch from scottk@utig.ig.utexas.edu (Scott Kempf):
dirsearch.cc (opendir): fix problem with accessing "/" dirsearch.cc (opendir): fix problem with accessing "/"
Mon Feb 10 13:57:11 1997 Geoffrey Noer <noer@cygnus.com> Mon Feb 10 13:57:11 1997 Geoffrey Noer <noer@cygnus.com>
@ -2688,7 +2688,7 @@ Mon Feb 3 16:16:39 1997 Jeremy Allison <jra@cygnus.com>
* fhandler.cc: Removed open_helper, turned it into * fhandler.cc: Removed open_helper, turned it into
fhandler_base::open and added fhandler_disk_file::open. More fhandler_base::open and added fhandler_disk_file::open. More
correct C++. correct C++.
fhandler_disk_file: Moved check_execable_p into fhandler_disk_file. fhandler_disk_file: Moved check_execable_p into fhandler_disk_file.
tty ports are now closed correctly. tty ports are now closed correctly.
* fhandler.h: Changes to support the above. * fhandler.h: Changes to support the above.
@ -2753,7 +2753,7 @@ Thu Jan 9 14:20:01 1997 Jeremy Allison <jra@cygnus.com>
* cygwin.din: Added cygwin32_getprotobynumber and * cygwin.din: Added cygwin32_getprotobynumber and
cygwin32_getservbyport. cygwin32_getservbyport.
* net.cc: Added cygwin32_getprotobynumber and * net.cc: Added cygwin32_getprotobynumber and
cygwin32_getservbyport. cygwin32_getservbyport.
Wed Jan 8 14:15:35 1997 Jeremy Allison <jra@cygnus.com> Wed Jan 8 14:15:35 1997 Jeremy Allison <jra@cygnus.com>

View File

@ -47,7 +47,7 @@
/* If using the C implementation of alloca, define if you know the /* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be direction of stack growth for your system; otherwise it will be
automatically deduced at run-time. automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */ STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION #undef STACK_DIRECTION

View File

@ -406,7 +406,7 @@ class cygheap_fdenum : public cygheap_fdmanip
{ {
while (++fd < (int) cygheap->fdtab.size) while (++fd < (int) cygheap->fdtab.size)
if (*(fh = cygheap->fdtab + fd) != NULL) if (*(fh = cygheap->fdtab + fd) != NULL)
return fd; return fd;
return -1; return -1;
} }
void rewind () void rewind ()

View File

@ -120,17 +120,17 @@ dlsym (void *handle, const char *name)
HMODULE *modules; HMODULE *modules;
DWORD needed, i; DWORD needed, i;
if (!EnumProcessModules (cur_proc, NULL, 0, &needed)) if (!EnumProcessModules (cur_proc, NULL, 0, &needed))
{ {
dlsym_fail: dlsym_fail:
set_dl_error ("dlsym"); set_dl_error ("dlsym");
return NULL; return NULL;
} }
modules = (HMODULE*) alloca (needed); modules = (HMODULE*) alloca (needed);
if (!EnumProcessModules (cur_proc, modules, needed, &needed)) if (!EnumProcessModules (cur_proc, modules, needed, &needed))
goto dlsym_fail; goto dlsym_fail;
for (i = 0; i < needed / sizeof (HMODULE); i++) for (i = 0; i < needed / sizeof (HMODULE); i++)
if ((ret = (void *) GetProcAddress (modules[i], name))) if ((ret = (void *) GetProcAddress (modules[i], name)))
break; break;
} }
else else
ret = (void *) GetProcAddress ((HMODULE)handle, name); ret = (void *) GetProcAddress ((HMODULE)handle, name);

View File

@ -120,7 +120,7 @@ fhandler_base::fstat_by_handle (struct __stat64 *buf)
debug_printf ("%u = NtQueryVolumeInformationFile)", debug_printf ("%u = NtQueryVolumeInformationFile)",
RtlNtStatusToDosError (status)); RtlNtStatusToDosError (status));
pfvi->VolumeSerialNumber = 0; /* Set to pc.volser () in helper. */ pfvi->VolumeSerialNumber = 0; /* Set to pc.volser () in helper. */
} }
status = NtQueryInformationFile (get_handle (), &io, pfai, fai_size, status = NtQueryInformationFile (get_handle (), &io, pfai, fai_size,
FileAllInformation); FileAllInformation);
if (NT_SUCCESS (status)) if (NT_SUCCESS (status))

View File

@ -118,11 +118,11 @@ fhandler_process::exists ()
{ {
fileid = PROCESS_FD; fileid = PROCESS_FD;
if (fill_filebuf ()) if (fill_filebuf ())
return -2; return -2;
/* Check for nameless device entries. */ /* Check for nameless device entries. */
path = strrchr (path, '/'); path = strrchr (path, '/');
if (path && *++path) if (path && *++path)
{ {
if (!strncmp (path, "pipe:[", 6)) if (!strncmp (path, "pipe:[", 6))
return -3; return -3;
else if (!strncmp (path, "socket:[", 8)) else if (!strncmp (path, "socket:[", 8))
@ -211,7 +211,7 @@ fhandler_process::readdir (DIR * dir)
if (fileid == PROCESS_FD) if (fileid == PROCESS_FD)
{ {
if (dir->__d_position >= 2 + filesize / sizeof (int)) if (dir->__d_position >= 2 + filesize / sizeof (int))
return NULL; return NULL;
} }
else if (dir->__d_position >= PROCESS_LINK_COUNT) else if (dir->__d_position >= PROCESS_LINK_COUNT)
return NULL; return NULL;
@ -414,7 +414,7 @@ fhandler_process::fill_filebuf ()
case PROCESS_CWD: case PROCESS_CWD:
case PROCESS_CMDLINE: case PROCESS_CMDLINE:
{ {
if (filebuf) if (filebuf)
free (filebuf); free (filebuf);
size_t fs; size_t fs;
switch (fileid) switch (fileid)

View File

@ -104,8 +104,8 @@ get_inet_addr (const struct sockaddr *in, int inlen,
*outlen = sizeof sin; *outlen = sizeof sin;
if (type) if (type)
*type = (ctype == 's' ? SOCK_STREAM : *type = (ctype == 's' ? SOCK_STREAM :
ctype == 'd' ? SOCK_DGRAM ctype == 'd' ? SOCK_DGRAM
: 0); : 0);
ret = 1; ret = 1;
} }
CloseHandle (fh); CloseHandle (fh);
@ -217,7 +217,7 @@ fhandler_socket::af_local_recv_secret (void)
debug_printf ("Received af_local secret: %08x-%08x-%08x-%08x", debug_printf ("Received af_local secret: %08x-%08x-%08x-%08x",
out[0], out[1], out[2], out[3]); out[0], out[1], out[2], out[3]);
if (out[0] != connect_secret[0] || out[1] != connect_secret[1] if (out[0] != connect_secret[0] || out[1] != connect_secret[1]
|| out[2] != connect_secret[2] || out[3] != connect_secret[3]) || out[2] != connect_secret[2] || out[3] != connect_secret[3])
{ {
debug_printf ("Receiving af_local secret mismatch"); debug_printf ("Receiving af_local secret mismatch");
return false; return false;
@ -463,7 +463,7 @@ fhandler_socket::dup (fhandler_base *child)
{ {
fhs->set_sun_path (get_sun_path ()); fhs->set_sun_path (get_sun_path ());
if (get_socket_type () == SOCK_STREAM) if (get_socket_type () == SOCK_STREAM)
{ {
fhs->sec_pid = sec_pid; fhs->sec_pid = sec_pid;
fhs->sec_uid = sec_uid; fhs->sec_uid = sec_uid;
fhs->sec_gid = sec_gid; fhs->sec_gid = sec_gid;
@ -524,7 +524,7 @@ fhandler_socket::fstat (struct __stat64 *buf)
{ {
res = fhandler_base::fstat_fs (buf); res = fhandler_base::fstat_fs (buf);
if (!res) if (!res)
{ {
buf->st_mode = (buf->st_mode & ~S_IFMT) | S_IFSOCK; buf->st_mode = (buf->st_mode & ~S_IFMT) | S_IFSOCK;
} }
} }
@ -800,7 +800,7 @@ fhandler_socket::accept (struct sockaddr *peer, int *len)
{ {
sock->set_sun_path (get_sun_path ()); sock->set_sun_path (get_sun_path ());
if (get_socket_type () == SOCK_STREAM) if (get_socket_type () == SOCK_STREAM)
{ {
/* Don't forget to copy credentials from accepting /* Don't forget to copy credentials from accepting
socket to accepted socket and start transaction socket to accepted socket and start transaction
on accepted socket! */ on accepted socket! */
@ -812,7 +812,7 @@ fhandler_socket::accept (struct sockaddr *peer, int *len)
set_winsock_errno (); set_winsock_errno ();
goto out; goto out;
} }
} }
} }
sock->connect_state (connected); sock->connect_state (connected);
res = res_fd; res = res_fd;
@ -1652,7 +1652,7 @@ fhandler_socket::getpeereid (pid_t *pid, __uid32_t *euid, __gid32_t *egid)
if (sec_peer_pid == (pid_t) 0) if (sec_peer_pid == (pid_t) 0)
{ {
set_errno (ENOTCONN); /* Usually when calling getpeereid on set_errno (ENOTCONN); /* Usually when calling getpeereid on
accepting (instead of accepted) socket. */ accepting (instead of accepted) socket. */
return -1; return -1;
} }

View File

@ -56,7 +56,7 @@ will be autoloaded. To do so, add one of the LoadDllfunc* macros to
autoload.cc. All macros eventually resolve to the following form: autoload.cc. All macros eventually resolve to the following form:
LoadDLLfuncEx2 (function name, parameter block length, dll name, LoadDLLfuncEx2 (function name, parameter block length, dll name,
non-fatality flag , value to return if function not available) non-fatality flag , value to return if function not available)
Parameter block length is a sum of sizes (in bytes) of parameters which are Parameter block length is a sum of sizes (in bytes) of parameters which are
being passed to the function. If non-fatality flag is set to 0, then failure being passed to the function. If non-fatality flag is set to 0, then failure

View File

@ -235,14 +235,14 @@ details. */
108: Remove unused (hopefully) reent_data export. 108: Remove unused (hopefully) reent_data export.
109: Oh well. Someone uses reent_data. 109: Oh well. Someone uses reent_data.
110: Export clock_gettime, sigwaitinfo, timer_create, timer_delete, 110: Export clock_gettime, sigwaitinfo, timer_create, timer_delete,
timer_settime timer_settime
111: Export sigqueue, sighold. 111: Export sigqueue, sighold.
112: Redefine some mtget fields. 112: Redefine some mtget fields.
113: Again redefine some mtget fields. Use mt_fileno and mt_blkno as 113: Again redefine some mtget fields. Use mt_fileno and mt_blkno as
on Linux. on Linux.
114: Export rand_r, ttyname_r. 114: Export rand_r, ttyname_r.
115: Export flockfile, ftrylockfile, funlockfile, getgrgid_r, getgrnam_r, 115: Export flockfile, ftrylockfile, funlockfile, getgrgid_r, getgrnam_r,
getlogin_r. getlogin_r.
116: Export atoll. 116: Export atoll.
117: Export utmpx functions, Return utmp * from pututent. 117: Export utmpx functions, Return utmp * from pututent.
118: Export getpriority, setpriority. 118: Export getpriority, setpriority.

View File

@ -60,29 +60,29 @@
*/ */
struct ip { struct ip {
#ifdef _IP_VHL #ifdef _IP_VHL
u_char ip_vhl; /* version << 4 | header length >> 2 */ u_char ip_vhl; /* version << 4 | header length >> 2 */
#else #else
#if BYTE_ORDER == LITTLE_ENDIAN #if BYTE_ORDER == LITTLE_ENDIAN
u_int ip_hl:4, /* header length */ u_int ip_hl:4, /* header length */
ip_v:4; /* version */ ip_v:4; /* version */
#endif #endif
#if BYTE_ORDER == BIG_ENDIAN #if BYTE_ORDER == BIG_ENDIAN
u_int ip_v:4, /* version */ u_int ip_v:4, /* version */
ip_hl:4; /* header length */ ip_hl:4; /* header length */
#endif #endif
#endif /* not _IP_VHL */ #endif /* not _IP_VHL */
u_char ip_tos; /* type of service */ u_char ip_tos; /* type of service */
u_short ip_len; /* total length */ u_short ip_len; /* total length */
u_short ip_id; /* identification */ u_short ip_id; /* identification */
u_short ip_off; /* fragment offset field */ u_short ip_off; /* fragment offset field */
#define IP_RF 0x8000 /* reserved fragment flag */ #define IP_RF 0x8000 /* reserved fragment flag */
#define IP_DF 0x4000 /* dont fragment flag */ #define IP_DF 0x4000 /* dont fragment flag */
#define IP_MF 0x2000 /* more fragments flag */ #define IP_MF 0x2000 /* more fragments flag */
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ #define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
u_char ip_ttl; /* time to live */ u_char ip_ttl; /* time to live */
u_char ip_p; /* protocol */ u_char ip_p; /* protocol */
u_short ip_sum; /* checksum */ u_short ip_sum; /* checksum */
struct in_addr ip_src,ip_dst; /* source and dest address */ struct in_addr ip_src,ip_dst; /* source and dest address */
}; };
#ifdef _IP_VHL #ifdef _IP_VHL
@ -155,24 +155,24 @@ struct ip {
* Time stamp option structure. * Time stamp option structure.
*/ */
struct ip_timestamp { struct ip_timestamp {
u_char ipt_code; /* IPOPT_TS */ u_char ipt_code; /* IPOPT_TS */
u_char ipt_len; /* size of structure (variable) */ u_char ipt_len; /* size of structure (variable) */
u_char ipt_ptr; /* index of current entry */ u_char ipt_ptr; /* index of current entry */
#if BYTE_ORDER == LITTLE_ENDIAN #if BYTE_ORDER == LITTLE_ENDIAN
u_int ipt_flg:4, /* flags, see below */ u_int ipt_flg:4, /* flags, see below */
ipt_oflw:4; /* overflow counter */ ipt_oflw:4; /* overflow counter */
#endif #endif
#if BYTE_ORDER == BIG_ENDIAN #if BYTE_ORDER == BIG_ENDIAN
u_int ipt_oflw:4, /* overflow counter */ u_int ipt_oflw:4, /* overflow counter */
ipt_flg:4; /* flags, see below */ ipt_flg:4; /* flags, see below */
#endif #endif
union ipt_timestamp { union ipt_timestamp {
n_long ipt_time[1]; n_long ipt_time[1];
struct ipt_ta { struct ipt_ta {
struct in_addr ipt_addr; struct in_addr ipt_addr;
n_long ipt_time; n_long ipt_time;
} ipt_ta[1]; } ipt_ta[1];
} ipt_timestamp; } ipt_timestamp;
}; };
/* flag bits for ipt_flg */ /* flag bits for ipt_flg */

View File

@ -57,19 +57,19 @@ typedef u_int32_t tcp_cc; /* connection count per rfc1644 */
* Per RFC 793, September, 1981. * Per RFC 793, September, 1981.
*/ */
struct tcphdr { struct tcphdr {
u_short th_sport; /* source port */ u_short th_sport; /* source port */
u_short th_dport; /* destination port */ u_short th_dport; /* destination port */
tcp_seq th_seq; /* sequence number */ tcp_seq th_seq; /* sequence number */
tcp_seq th_ack; /* acknowledgement number */ tcp_seq th_ack; /* acknowledgement number */
#if BYTE_ORDER == LITTLE_ENDIAN #if BYTE_ORDER == LITTLE_ENDIAN
u_int th_x2:4, /* (unused) */ u_int th_x2:4, /* (unused) */
th_off:4; /* data offset */ th_off:4; /* data offset */
#endif #endif
#if BYTE_ORDER == BIG_ENDIAN #if BYTE_ORDER == BIG_ENDIAN
u_int th_off:4, /* data offset */ u_int th_off:4, /* data offset */
th_x2:4; /* (unused) */ th_x2:4; /* (unused) */
#endif #endif
u_char th_flags; u_char th_flags;
#define TH_FIN 0x01 #define TH_FIN 0x01
#define TH_SYN 0x02 #define TH_SYN 0x02
#define TH_RST 0x04 #define TH_RST 0x04
@ -78,9 +78,9 @@ struct tcphdr {
#define TH_URG 0x20 #define TH_URG 0x20
#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG) #define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG)
u_short th_win; /* window */ u_short th_win; /* window */
u_short th_sum; /* checksum */ u_short th_sum; /* checksum */
u_short th_urp; /* urgent pointer */ u_short th_urp; /* urgent pointer */
}; };
#define TCPOPT_EOL 0 #define TCPOPT_EOL 0
@ -129,7 +129,7 @@ struct tcphdr {
#define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */ #define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */
#define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr)) #define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr))
/* max space left for options */ /* max space left for options */
/* /*
* User-settable options (used with setsockopt). * User-settable options (used with setsockopt).

View File

@ -117,8 +117,8 @@ void _pthread_cleanup_push (__pthread_cleanup_handler *handler);
void _pthread_cleanup_pop (int execute); void _pthread_cleanup_pop (int execute);
#define pthread_cleanup_push(_fn, _arg) { __pthread_cleanup_handler __cleanup_handler = \ #define pthread_cleanup_push(_fn, _arg) { __pthread_cleanup_handler __cleanup_handler = \
{ _fn, _arg, NULL }; \ { _fn, _arg, NULL }; \
_pthread_cleanup_push( &__cleanup_handler ); _pthread_cleanup_push( &__cleanup_handler );
#define pthread_cleanup_pop(_execute) _pthread_cleanup_pop( _execute ); } #define pthread_cleanup_pop(_execute) _pthread_cleanup_pop( _execute ); }
/* Condition variables */ /* Condition variables */
@ -174,7 +174,7 @@ int pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock);
int pthread_rwlock_unlock (pthread_rwlock_t *rwlock); int pthread_rwlock_unlock (pthread_rwlock_t *rwlock);
int pthread_rwlockattr_init (pthread_rwlockattr_t *rwlockattr); int pthread_rwlockattr_init (pthread_rwlockattr_t *rwlockattr);
int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr, int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr,
int *pshared); int *pshared);
int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, int pshared); int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, int pshared);
int pthread_rwlockattr_destroy (pthread_rwlockattr_t *rwlockattr); int pthread_rwlockattr_destroy (pthread_rwlockattr_t *rwlockattr);

View File

@ -3,8 +3,8 @@ copyrighted by UCB Berkeley or the Free Software Foundation.
Copyright Information for sources and executables that are marked Copyright Information for sources and executables that are marked
Copyright (C) DJ Delorie Copyright (C) DJ Delorie
24 Kirsten Ave 24 Kirsten Ave
Rochester NH 03867-2954 Rochester NH 03867-2954
This document is Copyright (C) DJ Delorie and may be distributed This document is Copyright (C) DJ Delorie and may be distributed
verbatim, but changing it is not allowed. verbatim, but changing it is not allowed.

View File

@ -255,7 +255,7 @@ mmap_record::map_pages (caddr_t addr, DWORD len)
for (DWORD l = 0; l < len; ++l) for (DWORD l = 0; l < len; ++l)
if (MAP_ISSET (off + l)) if (MAP_ISSET (off + l))
{ {
set_errno (EINVAL); set_errno (EINVAL);
return false; return false;
} }
switch (access_mode_) switch (access_mode_)
@ -553,7 +553,7 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off)
} }
fh = cfd; fh = cfd;
if (fh->get_device () == FH_ZERO) if (fh->get_device () == FH_ZERO)
{ {
/* mmap /dev/zero is like MAP_ANONYMOUS. */ /* mmap /dev/zero is like MAP_ANONYMOUS. */
fd = -1; fd = -1;
flags |= MAP_ANONYMOUS; flags |= MAP_ANONYMOUS;
@ -600,11 +600,11 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off)
return MAP_FAILED; return MAP_FAILED;
} }
/* Don't map beyond EOF. Windows would change the file to the /* Don't map beyond EOF. Windows would change the file to the
new length otherwise, in contrast to POSIX. Allow mapping new length otherwise, in contrast to POSIX. Allow mapping
beyon EOF if MAP_AUTOGROW flag is set. */ beyon EOF if MAP_AUTOGROW flag is set. */
fsiz -= gran_off; fsiz -= gran_off;
if (gran_len > fsiz) if (gran_len > fsiz)
{ {
if ((flags & MAP_AUTOGROW) && (off - gran_off) + len > fsiz) if ((flags & MAP_AUTOGROW) && (off - gran_off) + len > fsiz)
{ {
/* Check if file has been opened for writing. */ /* Check if file has been opened for writing. */
@ -621,9 +621,9 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off)
gran_len = fsiz; gran_len = fsiz;
} }
/* If the requested len is <= file size, drop the MAP_AUTOGROW flag. /* If the requested len is <= file size, drop the MAP_AUTOGROW flag.
This simplifes fhandler::mmap's job. */ This simplifes fhandler::mmap's job. */
if ((flags & MAP_AUTOGROW) && gran_len <= fsiz) if ((flags & MAP_AUTOGROW) && gran_len <= fsiz)
flags &= ~MAP_AUTOGROW; flags &= ~MAP_AUTOGROW;
} }
DWORD access = (prot & PROT_WRITE) ? FILE_MAP_WRITE : FILE_MAP_READ; DWORD access = (prot & PROT_WRITE) ? FILE_MAP_WRITE : FILE_MAP_READ;
@ -675,7 +675,7 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off)
DWORD u_len; DWORD u_len;
long record_idx = -1; long record_idx = -1;
if ((record_idx = map_list->search_record ((caddr_t)addr, len, if ((record_idx = map_list->search_record ((caddr_t)addr, len,
u_addr, u_len, u_addr, u_len,
record_idx)) >= 0) record_idx)) >= 0)
{ {
mmap_record *rec = map_list->get_record (record_idx); mmap_record *rec = map_list->get_record (record_idx);
@ -1073,14 +1073,14 @@ fhandler_disk_file::mmap (caddr_t *addr, size_t len, DWORD access,
high = (off + len) >> 32; high = (off + len) >> 32;
low = (off + len) & UINT32_MAX; low = (off + len) & UINT32_MAX;
/* Auto-grow in CreateFileMapping only works if the protection is /* Auto-grow in CreateFileMapping only works if the protection is
PAGE_READWRITE. So, first we call CreateFileMapping with PAGE_READWRITE. So, first we call CreateFileMapping with
PAGE_READWRITE, then, if the requested protection is different, we PAGE_READWRITE, then, if the requested protection is different, we
close the mapping and reopen it again with the correct protection, close the mapping and reopen it again with the correct protection,
*iff* auto-grow worked. */ *iff* auto-grow worked. */
h = CreateFileMapping (get_handle (), &sec_none, PAGE_READWRITE, h = CreateFileMapping (get_handle (), &sec_none, PAGE_READWRITE,
high, low, NULL); high, low, NULL);
if (h && protect != PAGE_READWRITE) if (h && protect != PAGE_READWRITE)
{ {
CloseHandle (h); CloseHandle (h);
h = CreateFileMapping (get_handle (), &sec_none, protect, h = CreateFileMapping (get_handle (), &sec_none, protect,
high, low, NULL); high, low, NULL);
@ -1114,7 +1114,7 @@ fhandler_disk_file::mmap (caddr_t *addr, size_t len, DWORD access,
ulen, &phys, &ulen, ViewShare, ulen, &phys, &ulen, ViewShare,
base ? AT_ROUND_TO_PAGE : 0, protect); base ? AT_ROUND_TO_PAGE : 0, protect);
if (ret != STATUS_SUCCESS) if (ret != STATUS_SUCCESS)
{ {
__seterrno_from_nt_status (ret); __seterrno_from_nt_status (ret);
base = NULL; base = NULL;
} }
@ -1196,7 +1196,7 @@ fhandler_disk_file::fixup_mmap_after_fork (HANDLE h, DWORD access, int flags,
ulen, &phys, &ulen, ViewShare, ulen, &phys, &ulen, ViewShare,
AT_ROUND_TO_PAGE, protect); AT_ROUND_TO_PAGE, protect);
if (ret != STATUS_SUCCESS) if (ret != STATUS_SUCCESS)
__seterrno_from_nt_status (ret); __seterrno_from_nt_status (ret);
} }
else else
base = MapViewOfFileEx (h, access, 0, offset, size, address); base = MapViewOfFileEx (h, access, 0, offset, size, address);

View File

@ -768,7 +768,7 @@ cygwin_getsockopt (int fd, int level, int optname, void *optval, int *optlen)
name = "SO_ERROR"; name = "SO_ERROR";
break; break;
case SO_PEERCRED: case SO_PEERCRED:
name = "SO_PEERCRED"; name = "SO_PEERCRED";
} }
if ((optval if ((optval

View File

@ -18,7 +18,7 @@ _$newsym:
.section .idata\$7 .section .idata\$7
.long __head_cygwin1_dll .long __head_cygwin1_dll
.section .idata\$5 .section .idata\$5
__imp__$newsym: .rva 1f __imp__$newsym: .rva 1f
.section .idata\$4 .section .idata\$4

View File

@ -637,7 +637,7 @@ path_conv::check (const char *src, unsigned opt,
fhandler_virtual *fh = (fhandler_virtual *) build_fh_dev (dev, path_copy); fhandler_virtual *fh = (fhandler_virtual *) build_fh_dev (dev, path_copy);
int file_type = fh->exists (); int file_type = fh->exists ();
if (file_type == -2) if (file_type == -2)
{ {
fh->fill_filebuf (); fh->fill_filebuf ();
symlen = sym.set (fh->get_filebuf ()); symlen = sym.set (fh->get_filebuf ());
} }
@ -756,11 +756,11 @@ is_virtual_symlink:
error = sym.error; error = sym.error;
if (component == 0) if (component == 0)
add_ext_from_sym (sym); add_ext_from_sym (sym);
else if (!(sym.fileattr & FILE_ATTRIBUTE_DIRECTORY)) else if (!(sym.fileattr & FILE_ATTRIBUTE_DIRECTORY))
{ {
error = ENOTDIR; error = ENOTDIR;
goto out; goto out;
} }
if (pcheck_case == PCHECK_RELAXED) if (pcheck_case == PCHECK_RELAXED)
goto out; // file found goto out; // file found
/* Avoid further symlink evaluation. Only case checks are /* Avoid further symlink evaluation. Only case checks are
@ -2509,7 +2509,7 @@ is_floppy (const char *dos)
if (!QueryDosDevice (dos, dev, 256)) if (!QueryDosDevice (dos, dev, 256))
return false; return false;
return strncasematch (dev, "\\Device\\Floppy", 14) return strncasematch (dev, "\\Device\\Floppy", 14)
|| strcasematch (dev, "A:"); || strcasematch (dev, "A:");
} }
extern "C" FILE * extern "C" FILE *
@ -2652,7 +2652,7 @@ symlink_worker (const char *topath, const char *frompath, bool use_winsym,
{ {
win32_topath.check (topath, PC_SYM_NOFOLLOW); win32_topath.check (topath, PC_SYM_NOFOLLOW);
if (win32_topath.error != ENOENT) if (win32_topath.error != ENOENT)
strcpy (use_winsym ? reltopath : w32topath, win32_topath); strcpy (use_winsym ? reltopath : w32topath, win32_topath);
} }
else if (!use_winsym) else if (!use_winsym)
strcpy (w32topath, reltopath); strcpy (w32topath, reltopath);
@ -2668,7 +2668,7 @@ symlink_worker (const char *topath, const char *frompath, bool use_winsym,
} }
} }
else else
{ {
win32_topath.check (topath, PC_FULL | PC_SYM_NOFOLLOW); win32_topath.check (topath, PC_FULL | PC_SYM_NOFOLLOW);
strcpy (w32topath, win32_topath); strcpy (w32topath, win32_topath);
} }
@ -2802,7 +2802,7 @@ cmp_shortcut_header (win_shortcut_hdr *file_header)
return file_header->size == sizeof (win_shortcut_hdr) return file_header->size == sizeof (win_shortcut_hdr)
&& !memcmp (&file_header->magic, &GUID_shortcut, sizeof GUID_shortcut) && !memcmp (&file_header->magic, &GUID_shortcut, sizeof GUID_shortcut)
&& (file_header->flags & ~WSH_FLAG_IDLIST) && (file_header->flags & ~WSH_FLAG_IDLIST)
== (WSH_FLAG_DESC | WSH_FLAG_RELPATH) == (WSH_FLAG_DESC | WSH_FLAG_RELPATH)
&& file_header->run == SW_NORMAL; && file_header->run == SW_NORMAL;
} }
@ -4014,7 +4014,7 @@ basename (char *path)
{ {
/* Trailing (back)slashes are eliminated. */ /* Trailing (back)slashes are eliminated. */
while (c && c > bs && c[1] == '\0') while (c && c > bs && c[1] == '\0')
{ {
*c = '\0'; *c = '\0';
c = strrchr (bs, '/'); c = strrchr (bs, '/');
if ((d = strrchr (c ?: bs, '\\')) > c) if ((d = strrchr (c ?: bs, '\\')) > c)
@ -4052,22 +4052,22 @@ dirname (char *path)
{ {
/* Trailing (back)slashes are eliminated. */ /* Trailing (back)slashes are eliminated. */
while (c && c > bs && c[1] == '\0') while (c && c > bs && c[1] == '\0')
{ {
*c = '\0'; *c = '\0';
c = strrchr (bs, '/'); c = strrchr (bs, '/');
if ((d = strrchr (c ?: bs, '\\')) > c) if ((d = strrchr (c ?: bs, '\\')) > c)
c = d; c = d;
} }
if (!c) if (!c)
strcpy (bs, "."); strcpy (bs, ".");
else if (c > bs) else if (c > bs)
{ {
/* More trailing (back)slashes are eliminated. */ /* More trailing (back)slashes are eliminated. */
while (c > bs && (*c == '/' || *c == '\\')) while (c > bs && (*c == '/' || *c == '\\'))
*c-- = '\0'; *c-- = '\0';
} }
else else
c[1] = '\0'; c[1] = '\0';
} }
else else
strcpy (bs, "."); strcpy (bs, ".");

View File

@ -114,7 +114,7 @@ pinfo::maybe_set_exit_code_from_windows ()
if (hProcess && !(self->exitcode & EXITCODE_SET)) if (hProcess && !(self->exitcode & EXITCODE_SET))
{ {
WaitForSingleObject (hProcess, INFINITE); // just to be safe, in case WaitForSingleObject (hProcess, INFINITE); // just to be safe, in case
// process hasn't quite exited // process hasn't quite exited
// after closing pipe // after closing pipe
GetExitCodeProcess (hProcess, &x); GetExitCodeProcess (hProcess, &x);
self->exitcode = EXITCODE_SET | (x & 0xff) << 8; self->exitcode = EXITCODE_SET | (x & 0xff) << 8;
@ -467,7 +467,7 @@ _pinfo::commune_recv ()
} }
case PICOM_CWD: case PICOM_CWD:
{ {
CloseHandle (__fromthem); __fromthem = NULL; CloseHandle (__fromthem); __fromthem = NULL;
CloseHandle (hp); CloseHandle (hp);
unsigned int n = strlen (cygheap->cwd.get (path, 1, 1, unsigned int n = strlen (cygheap->cwd.get (path, 1, 1,
CYG_MAX_PATH)) + 1; CYG_MAX_PATH)) + 1;
@ -479,7 +479,7 @@ _pinfo::commune_recv ()
} }
case PICOM_ROOT: case PICOM_ROOT:
{ {
CloseHandle (__fromthem); __fromthem = NULL; CloseHandle (__fromthem); __fromthem = NULL;
CloseHandle (hp); CloseHandle (hp);
unsigned int n; unsigned int n;
if (cygheap->root.exists ()) if (cygheap->root.exists ())
@ -494,7 +494,7 @@ _pinfo::commune_recv ()
} }
case PICOM_FDS: case PICOM_FDS:
{ {
CloseHandle (__fromthem); __fromthem = NULL; CloseHandle (__fromthem); __fromthem = NULL;
CloseHandle (hp); CloseHandle (hp);
unsigned int n = 0; unsigned int n = 0;
int fd; int fd;
@ -511,7 +511,7 @@ _pinfo::commune_recv ()
sigproc_printf ("WriteFile fd %d failed, %E", fd); sigproc_printf ("WriteFile fd %d failed, %E", fd);
break; break;
} }
break; break;
} }
case PICOM_PIPE_FHANDLER: case PICOM_PIPE_FHANDLER:
{ {
@ -563,7 +563,7 @@ _pinfo::commune_recv ()
sigproc_printf ("WriteFile sizeof fd failed, %E"); sigproc_printf ("WriteFile sizeof fd failed, %E");
else if (!WriteFile (__tothem, path, n, &nr, NULL)) else if (!WriteFile (__tothem, path, n, &nr, NULL))
sigproc_printf ("WriteFile fd failed, %E"); sigproc_printf ("WriteFile fd failed, %E");
break; break;
} }
case PICOM_FIFO: case PICOM_FIFO:
{ {
@ -729,9 +729,9 @@ _pinfo::commune_send (DWORD code, ...)
goto err; goto err;
} }
if (!n) if (!n)
res.s = NULL; res.s = NULL;
else else
{ {
res.s = (char *) malloc (n); res.s = (char *) malloc (n);
char *p; char *p;
for (p = res.s; ReadFile (fromthem, p, n, &nr, NULL); p += nr) for (p = res.s; ReadFile (fromthem, p, n, &nr, NULL); p += nr)
@ -741,7 +741,7 @@ _pinfo::commune_send (DWORD code, ...)
__seterrno (); __seterrno ();
goto err; goto err;
} }
} }
res.n = n; res.n = n;
break; break;
case PICOM_FIFO: case PICOM_FIFO:

View File

@ -360,7 +360,7 @@ void set_cygwin_privileges (HANDLE token);
#define pop_thread_privilege() \ #define pop_thread_privilege() \
if (_dup_token) \ if (_dup_token) \
{ \ { \
ImpersonateLoggedOnUser (_token); \ ImpersonateLoggedOnUser (_token); \
CloseHandle (_dup_token); \ CloseHandle (_dup_token); \
} \ } \
} }

View File

@ -180,7 +180,7 @@ pselect(int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
set_signal_mask (*set); set_signal_mask (*set);
} }
int ret = cygwin_select (maxfds, readfds, writefds, exceptfds, int ret = cygwin_select (maxfds, readfds, writefds, exceptfds,
ts ? &tv : NULL); ts ? &tv : NULL);
if (set) if (set)
set_signal_mask (oldset); set_signal_mask (oldset);
return ret; return ret;
@ -603,7 +603,7 @@ out:
gotone += s->write_ready = true; gotone += s->write_ready = true;
} }
#else #else
gotone += s->write_ready = true; gotone += s->write_ready = true;
#endif #endif
} }
} }

View File

@ -473,7 +473,7 @@ create_signal_arrived ()
ProtectHandle (signal_arrived); ProtectHandle (signal_arrived);
} }
/* Message initialization. Called from dll_crt0_1 /* Signal thread initialization. Called from dll_crt0_1.
This routine starts the signal handling thread. The wait_sig_inited This routine starts the signal handling thread. The wait_sig_inited
event is used to signal that the thread is ready to handle signals. event is used to signal that the thread is ready to handle signals.

View File

@ -149,7 +149,7 @@ strace::vsprntf (char *buf, const char *func, const char *infmt, va_list ap)
*p = '\000'; *p = '\000';
p = progname; p = progname;
count = __small_sprintf (buf, fmt, p && *p ? p : "?", count = __small_sprintf (buf, fmt, p && *p ? p : "?",
myself->pid ?: GetCurrentProcessId (), myself->pid ?: GetCurrentProcessId (),
execing ? "!" : ""); execing ? "!" : "");
if (func) if (func)
count += getfunc (buf + count, func); count += getfunc (buf + count, func);

View File

@ -951,9 +951,9 @@ sync ()
char b_drive[CYG_MAX_PATH] = {0}; char b_drive[CYG_MAX_PATH] = {0};
if (is_floppy ("A:")) if (is_floppy ("A:"))
GetVolumeNameForVolumeMountPointA ("A:\\", a_drive, CYG_MAX_PATH); GetVolumeNameForVolumeMountPointA ("A:\\", a_drive, CYG_MAX_PATH);
if (is_floppy ("B:")) if (is_floppy ("B:"))
GetVolumeNameForVolumeMountPointA ("B:\\", a_drive, CYG_MAX_PATH); GetVolumeNameForVolumeMountPointA ("B:\\", a_drive, CYG_MAX_PATH);
HANDLE sh = FindFirstVolumeA (vol, CYG_MAX_PATH); HANDLE sh = FindFirstVolumeA (vol, CYG_MAX_PATH);
if (sh != INVALID_HANDLE_VALUE) if (sh != INVALID_HANDLE_VALUE)
@ -964,7 +964,7 @@ sync ()
/* Check vol for being a floppy on A: or B:. Skip them. */ /* Check vol for being a floppy on A: or B:. Skip them. */
if (strcasematch (vol, a_drive) || strcasematch (vol, b_drive)) if (strcasematch (vol, a_drive) || strcasematch (vol, b_drive))
{ {
debug_printf ("Is floppy, don't sync"); debug_printf ("Is floppy, don't sync");
continue; continue;
} }
@ -988,7 +988,7 @@ sync ()
drives &= ~2; drives &= ~2;
strcpy (vol, "\\\\.\\A:"); strcpy (vol, "\\\\.\\A:");
do do
{ {
/* Geeh. Try to sync only non-floppy drives. */ /* Geeh. Try to sync only non-floppy drives. */
if (drives & mask) if (drives & mask)
{ {
@ -1208,9 +1208,9 @@ rename (const char *oldpath, const char *newpath)
if (real_old.isdir () if (real_old.isdir ()
&& ((lasterr == ERROR_SHARING_VIOLATION && wincap.has_move_file_ex ()) && ((lasterr == ERROR_SHARING_VIOLATION && wincap.has_move_file_ex ())
|| (lasterr == ERROR_ACCESS_DENIED && !real_new.exists () || (lasterr == ERROR_ACCESS_DENIED && !real_new.exists ()
&& !wincap.has_move_file_ex ()) && !wincap.has_move_file_ex ())
|| (lasterr == ERROR_ALREADY_EXISTS && real_new.exists () || (lasterr == ERROR_ALREADY_EXISTS && real_new.exists ()
&& !wincap.has_move_file_ex ())) && !wincap.has_move_file_ex ()))
&& (len = strlen (real_old), strncasematch (real_old, real_new, len)) && (len = strlen (real_old), strncasematch (real_old, real_new, len))
&& real_new[len] == '\\') && real_new[len] == '\\')
SetLastError (ERROR_INVALID_PARAMETER); SetLastError (ERROR_INVALID_PARAMETER);
@ -1743,7 +1743,7 @@ statvfs (const char *fname, struct statvfs *sfs)
else else
availc = freec; availc = freec;
if (GetVolumeInformation (root, NULL, 0, &vsn, &maxlen, &flags, NULL, 0)) if (GetVolumeInformation (root, NULL, 0, &vsn, &maxlen, &flags, NULL, 0))
{ {
sfs->f_bsize = spc*bps; sfs->f_bsize = spc*bps;
sfs->f_frsize = spc*bps; sfs->f_frsize = spc*bps;
sfs->f_blocks = totalc; sfs->f_blocks = totalc;
@ -1966,7 +1966,7 @@ extern "C" int
seteuid32 (__uid32_t uid) seteuid32 (__uid32_t uid)
{ {
debug_printf ("uid: %u myself->uid: %u myself->gid: %u", debug_printf ("uid: %u myself->uid: %u myself->gid: %u",
uid, myself->uid, myself->gid); uid, myself->uid, myself->gid);
if (uid == myself->uid && !cygheap->user.groups.ischanged) if (uid == myself->uid && !cygheap->user.groups.ischanged)
{ {
@ -2055,7 +2055,7 @@ seteuid32 (__uid32_t uid)
/* Try setting default DACL */ /* Try setting default DACL */
char dacl_buf[MAX_DACL_LEN (5)]; char dacl_buf[MAX_DACL_LEN (5)];
if (sec_acl ((PACL) dacl_buf, true, true, usersid)) if (sec_acl ((PACL) dacl_buf, true, true, usersid))
{ {
TOKEN_DEFAULT_DACL tdacl = { (PACL) dacl_buf }; TOKEN_DEFAULT_DACL tdacl = { (PACL) dacl_buf };
if (!SetTokenInformation (new_token, TokenDefaultDacl, if (!SetTokenInformation (new_token, TokenDefaultDacl,
&tdacl, sizeof (tdacl))) &tdacl, sizeof (tdacl)))
@ -2175,7 +2175,7 @@ setegid32 (__gid32_t gid)
{ {
/* If impersonated, update impersonation token... */ /* If impersonated, update impersonation token... */
if (!SetTokenInformation (cygheap->user.primary_token (), if (!SetTokenInformation (cygheap->user.primary_token (),
TokenPrimaryGroup, &gsid, sizeof gsid)) TokenPrimaryGroup, &gsid, sizeof gsid))
debug_printf ("SetTokenInformation(primary_token, " debug_printf ("SetTokenInformation(primary_token, "
"TokenPrimaryGroup), %E"); "TokenPrimaryGroup), %E");
if (!SetTokenInformation (cygheap->user.token (), TokenPrimaryGroup, if (!SetTokenInformation (cygheap->user.token (), TokenPrimaryGroup,
@ -2467,7 +2467,7 @@ getpriority (int which, id_t who)
{ {
_pinfo *p = pids[i]; _pinfo *p = pids[i];
if (p) if (p)
switch (which) switch (which)
{ {
case PRIO_PROCESS: case PRIO_PROCESS:
if ((pid_t) who == p->pid) if ((pid_t) who == p->pid)

View File

@ -1,6 +1,6 @@
/* syslog.cc /* syslog.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -201,11 +201,11 @@ try_connect_syslogd (const char *msg, int len)
if (stat64 (_PATH_LOG, &st) || !S_ISSOCK (st.st_mode)) if (stat64 (_PATH_LOG, &st) || !S_ISSOCK (st.st_mode))
goto out; goto out;
if ((fd = cygwin_socket (AF_LOCAL, SOCK_DGRAM, 0)) < 0) if ((fd = cygwin_socket (AF_LOCAL, SOCK_DGRAM, 0)) < 0)
goto out; goto out;
sa.sa_family = AF_LOCAL; sa.sa_family = AF_LOCAL;
strncpy (sa.sa_data, _PATH_LOG, sizeof sa.sa_data); strncpy (sa.sa_data, _PATH_LOG, sizeof sa.sa_data);
if (cygwin_connect (fd, &sa, sizeof sa)) if (cygwin_connect (fd, &sa, sizeof sa))
{ {
if (get_errno () != EPROTOTYPE) if (get_errno () != EPROTOTYPE)
{ {
close (fd); close (fd);
@ -230,9 +230,9 @@ out:
{ {
ret = write (syslogd_sock, msg, len); ret = write (syslogd_sock, msg, len);
/* If write fails and LOG_CONS is set, return failure to vsyslog so /* If write fails and LOG_CONS is set, return failure to vsyslog so
it falls back to the usual logging method for this OS. */ it falls back to the usual logging method for this OS. */
if (ret >= 0 || !(_my_tls.locals.process_logopt & LOG_CONS)) if (ret >= 0 || !(_my_tls.locals.process_logopt & LOG_CONS))
ret = syslogd_sock; ret = syslogd_sock;
} }
try_connect_guard.release (); try_connect_guard.release ();
return ret; return ret;

View File

@ -128,7 +128,7 @@ timer_thread (VOID *x)
long long sleep_us; long long sleep_us;
long sleep_ms; long sleep_ms;
/* Account for delays in starting thread /* Account for delays in starting thread
and sending the signal */ and sending the signal */
now = gtod.usecs (false); now = gtod.usecs (false);
sleep_us = sleepto_us - now; sleep_us = sleepto_us - now;
if (sleep_us > 0) if (sleep_us > 0)

View File

@ -450,7 +450,7 @@ cygheap_user::env_systemroot (const char *name, size_t namelen)
{ {
int size = GetWindowsDirectory (NULL, 0); int size = GetWindowsDirectory (NULL, 0);
if (size > 0) if (size > 0)
{ {
psystemroot = (char *) cmalloc (HEAP_STR, ++size); psystemroot = (char *) cmalloc (HEAP_STR, ++size);
size = GetWindowsDirectory (psystemroot, size); size = GetWindowsDirectory (psystemroot, size);
if (size <= 0) if (size <= 0)
@ -460,7 +460,7 @@ cygheap_user::env_systemroot (const char *name, size_t namelen)
} }
} }
if (size <= 0) if (size <= 0)
debug_printf ("GetWindowsDirectory(), %E"); debug_printf ("GetWindowsDirectory(), %E");
} }
return psystemroot; return psystemroot;
} }