diff options
author | Christopher Faylor <me@cgf.cx> | 2003-07-26 04:53:59 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-07-26 04:53:59 +0000 |
commit | df04ae29b258b89bbd4991bd862a03ac56430e4e (patch) | |
tree | f853669603e469c7c37bc4c829a247b16958464f /winsup/cygwin/net.cc | |
parent | ddb67621550071ee1472cb114704af155d46365b (diff) | |
download | cygnal-df04ae29b258b89bbd4991bd862a03ac56430e4e.tar.gz cygnal-df04ae29b258b89bbd4991bd862a03ac56430e4e.tar.bz2 cygnal-df04ae29b258b89bbd4991bd862a03ac56430e4e.zip |
* exceptions.cc (ctrl_c_handler): Send SIGHUP when events occur only if there
is a tty associated with the process. Send SIGHUP on CTRL_LOGOFF_EVENT.
* fhandler_tty.cc (fhandler_tty_slave::open): Adjust console open handle
counter regardless of whether this is a pty or tty.
(fhandler_tty_slave::open): Ditto.
(fhandler_tty_slave::dup): Ditto.
(fhandler_tty_common::set_close_on_exec): Ditto.
(fhandler_tty_master::init_console): Decrement console open handle counter
after init since it will now be handled by all tty open.
* syscalls.cc (setsid): Rework debugging output slightly.
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r-- | winsup/cygwin/net.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 25d82e110..3db52f883 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -522,7 +522,7 @@ fdsock (int &fd, const char *name, SOCKET soc) debug_printf ("not setting socket inheritance since winsock2_active %d", winsock2_active); fhandler_socket *fh = (fhandler_socket *) - cygheap->fdtab.build_fhandler (fd, FH_SOCKET, name, NULL, + cygheap->fdtab.build_fhandler (fd, FH_SOCKET, name, NULL, tolower (name[5]) - 'a'); if (!fh) return NULL; @@ -775,14 +775,14 @@ cygwin_connect (int fd, const struct sockaddr *name, int namelen) { bool was_blocking = false; if (!fh->is_nonblocking ()) - { + { int nonblocking = 1; fh->ioctl (FIONBIO, &nonblocking); was_blocking = true; } res = fh->connect (name, namelen); if (was_blocking) - { + { if (res == -1 && get_errno () == EINPROGRESS) { size_t fds_size = howmany (fd + 1, NFDBITS) * sizeof (fd_mask); @@ -794,7 +794,7 @@ cygwin_connect (int fd, const struct sockaddr *name, int namelen) FD_SET (fd, except_fds); res = cygwin_select (fd + 1, NULL, write_fds, except_fds, NULL); if (res > 0 && FD_ISSET (fd, except_fds)) - { + { res = -1; for (;;) { @@ -803,7 +803,7 @@ cygwin_connect (int fd, const struct sockaddr *name, int namelen) cygwin_getsockopt (fd, SOL_SOCKET, SO_ERROR, (void *) &err, &len); if (err) - { + { set_errno (err); break; } @@ -811,9 +811,9 @@ cygwin_connect (int fd, const struct sockaddr *name, int namelen) } } else if (res > 0) - res = 0; + res = 0; else - { + { WSASetLastError (WSAEINPROGRESS); set_winsock_errno (); } @@ -1304,7 +1304,7 @@ getdomainname (char *domain, size_t len) /* This is only used by Win95 and NT <= 4.0. The registry names are language independent. - FIXME: Handle DHCP on Win95. The DhcpDomain(s) may be available + FIXME: Handle DHCP on Win95. The DhcpDomain(s) may be available in ..VxD\DHCP\DhcpInfoXX\OptionInfo, RFC 1533 format */ reg_key r (HKEY_LOCAL_MACHINE, KEY_READ, @@ -2014,7 +2014,7 @@ cygwin_rcmd (char **ahost, unsigned short inport, char *locuser, fh = NULL; if (newfd >= 0) fh = fdsock (newfd, "/dev/tcp", fd2s); - if (fh) + if (fh) { *fd2p = newfd; fh->set_connect_state (CONNECTED); |