Change _function() to function() throughout.
* cygwin.din: Remove last vestiges (?) of newlib wrappers. * cygthread.cc (cygthread::detach): Always wait for event or suffer an apparently inavoidable race. * dcrt0.cc (dll_crt0_1): Allocate threads after stack has been relocated. * debub.cc (lock_debug): Don't acquire lock on exit. * fork.cc (fork_child): Recreate mmaps before doing anything else since Windows has a habit of using blocks of memory in the child that could previously have been occupied by shared memory in the parent. * mmap.cc (fhandler_disk_file::fixup_mmap_after_fork): Issue error here and provide some details about what went wrong. (fixup_mmaps_after_fork): Remove error message. * shared.cc (open_shared): Move warning message so that more detail is possible. * sigproc.cc (sigproc_init): Initialize sync_proc_subproc to avoid a race. (sigproc_terminate): Specifically wait for process thread to terminate.
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#define USE_SYS_TYPES_FD_SET
|
||||
#include <winsock2.h>
|
||||
#include "cygerrno.h"
|
||||
@@ -33,6 +32,7 @@
|
||||
#include "cygheap.h"
|
||||
#include "sigproc.h"
|
||||
#include "wsock_event.h"
|
||||
#include <unistd.h>
|
||||
|
||||
#define SECRET_EVENT_NAME "cygwin.local_socket.secret.%d.%08x-%08x-%08x-%08x"
|
||||
#define ENTROPY_SOURCE_NAME "/dev/urandom"
|
||||
@@ -61,7 +61,7 @@ get_inet_addr (const struct sockaddr *in, int inlen,
|
||||
}
|
||||
else if (in->sa_family == AF_LOCAL)
|
||||
{
|
||||
int fd = _open (in->sa_data, O_RDONLY);
|
||||
int fd = open (in->sa_data, O_RDONLY);
|
||||
if (fd == -1)
|
||||
return 0;
|
||||
|
||||
@@ -81,7 +81,7 @@ get_inet_addr (const struct sockaddr *in, int inlen,
|
||||
*outlen = sizeof sin;
|
||||
ret = 1;
|
||||
}
|
||||
_close (fd);
|
||||
close (fd);
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
@@ -354,9 +354,7 @@ fhandler_socket::bind (const struct sockaddr *name, int namelen)
|
||||
|
||||
/* bind must fail if file system socket object already exists
|
||||
so _open () is called with O_EXCL flag. */
|
||||
fd = _open (un_addr->sun_path,
|
||||
O_WRONLY | O_CREAT | O_EXCL | O_BINARY,
|
||||
0);
|
||||
fd = ::open (un_addr->sun_path, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0);
|
||||
if (fd < 0)
|
||||
{
|
||||
if (get_errno () == EEXIST)
|
||||
@@ -372,17 +370,17 @@ fhandler_socket::bind (const struct sockaddr *name, int namelen)
|
||||
len = strlen (buf) + 1;
|
||||
|
||||
/* Note that the terminating nul is written. */
|
||||
if (_write (fd, buf, len) != len)
|
||||
if (::write (fd, buf, len) != len)
|
||||
{
|
||||
save_errno here;
|
||||
_close (fd);
|
||||
_unlink (un_addr->sun_path);
|
||||
::close (fd);
|
||||
unlink (un_addr->sun_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
_close (fd);
|
||||
::close (fd);
|
||||
chmod (un_addr->sun_path,
|
||||
(S_IFSOCK | S_IRWXU | S_IRWXG | S_IRWXO) & ~cygheap->umask);
|
||||
(S_IFSOCK | S_IRWXU | S_IRWXG | S_IRWXO) & ~cygheap->umask);
|
||||
set_sun_path (un_addr->sun_path);
|
||||
res = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user