* fhandler_socket.cc (fhandler_socket::check_peer_secret_event):

Fix strace message.
	(fhandler_socket::connect): Remove sigframe.
	(fhandler_socket::accept): Ditto.
	(fhandler_socket::getsockname): Ditto.
	(fhandler_socket::getpeername): Ditto.
	(fhandler_socket::recvfrom): Ditto.
	(fhandler_socket::recvmsg): Ditto.
	(fhandler_socket::sendto): Ditto.
	(fhandler_socket::sendmsg): Ditto.
	(fhandler_socket::close): Ditto.
	(fhandler_socket::ioctl): Ditto.
	* ioctl.cc (ioctl): Add sigframe.
	*net.cc (cygwin_sendto): Ditto.
	(cygwin_recvfrom): Ditto.
	(cygwin_recvfrom): Ditto.
	(cygwin_connect): Ditto.
	(cygwin_shutdown): Ditto.
	(cygwin_getpeername): Ditto.
	(cygwin_accept): Ditto.  Improve strace message.
	(cygwin_getsockname): Ditto.  Ditto.
	(cygwin_recvmsg): Ditto.  Ditto.
	(cygwin_sendmsg): Fix strace message.
This commit is contained in:
Corinna Vinschen 2002-08-27 09:24:50 +00:00
parent 6d8bd861e2
commit 0a64232525
4 changed files with 50 additions and 25 deletions

View File

@ -1,3 +1,29 @@
2002-08-26 Conrad Scott <conrad.scott@dsl.pipex.com>
* fhandler_socket.cc (fhandler_socket::check_peer_secret_event):
Fix strace message.
(fhandler_socket::connect): Remove sigframe.
(fhandler_socket::accept): Ditto.
(fhandler_socket::getsockname): Ditto.
(fhandler_socket::getpeername): Ditto.
(fhandler_socket::recvfrom): Ditto.
(fhandler_socket::recvmsg): Ditto.
(fhandler_socket::sendto): Ditto.
(fhandler_socket::sendmsg): Ditto.
(fhandler_socket::close): Ditto.
(fhandler_socket::ioctl): Ditto.
* ioctl.cc (ioctl): Add sigframe.
*net.cc (cygwin_sendto): Ditto.
(cygwin_recvfrom): Ditto.
(cygwin_recvfrom): Ditto.
(cygwin_connect): Ditto.
(cygwin_shutdown): Ditto.
(cygwin_getpeername): Ditto.
(cygwin_accept): Ditto. Improve strace message.
(cygwin_getsockname): Ditto. Ditto.
(cygwin_recvmsg): Ditto. Ditto.
(cygwin_sendmsg): Fix strace message.
2002-08-27 Christopher Faylor <cgf@redhat.com>
* child_info.h: Add _PROC_WHOOPS enum value.

View File

@ -203,7 +203,7 @@ fhandler_socket::check_peer_secret_event (struct sockaddr_in* peer, int* secret)
ev = CreateEvent (&sec_all_nih, FALSE, FALSE, buf);
if (!ev && GetLastError () == ERROR_ALREADY_EXISTS)
{
debug_printf ("%s event already exist");
debug_printf ("event \"%s\" already exists", buf);
ev = OpenEvent (EVENT_ALL_ACCESS, FALSE, buf);
}
@ -406,8 +406,6 @@ fhandler_socket::connect (const struct sockaddr *name, int namelen)
sockaddr_in sin;
int secret [4];
sigframe thisframe (mainthread);
if (!get_inet_addr (name, namelen, &sin, &namelen, secret))
return -1;
@ -486,8 +484,6 @@ fhandler_socket::accept (struct sockaddr *peer, int *len)
BOOL secret_check_failed = FALSE;
BOOL in_progress = FALSE;
sigframe thisframe (mainthread);
/* Allows NULL peer and len parameters. */
struct sockaddr_in peer_dummy;
int len_dummy;
@ -624,8 +620,6 @@ fhandler_socket::getsockname (struct sockaddr *name, int *namelen)
{
int res = -1;
sigframe thisframe (mainthread);
if (get_addr_family () == AF_LOCAL)
{
struct sockaddr_un *sun = (struct sockaddr_un *) name;
@ -659,8 +653,6 @@ fhandler_socket::getsockname (struct sockaddr *name, int *namelen)
int
fhandler_socket::getpeername (struct sockaddr *name, int *namelen)
{
sigframe thisframe (mainthread);
int res = ::getpeername (get_socket (), name, namelen);
if (res)
set_winsock_errno ();
@ -682,8 +674,6 @@ fhandler_socket::recvfrom (void *ptr, size_t len, int flags,
wsock_event wsock_evt;
LPWSAOVERLAPPED ovr;
sigframe thisframe (mainthread);
if (is_nonblocking () || !(ovr = wsock_evt.prepare ()))
{
debug_printf ("Fallback to winsock 1 recvfrom call");
@ -723,8 +713,6 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags)
char *buf, *p;
struct iovec *iov = msg->msg_iov;
sigframe thisframe (mainthread);
if (get_addr_family () == AF_LOCAL)
{
/* On AF_LOCAL sockets the (fixed-size) name of the shared memory
@ -771,8 +759,6 @@ fhandler_socket::sendto (const void *ptr, size_t len, int flags,
LPWSAOVERLAPPED ovr;
sockaddr_in sin;
sigframe thisframe (mainthread);
if (to && !get_inet_addr (to, tolen, &sin, &tolen))
return -1;
@ -844,8 +830,6 @@ fhandler_socket::sendmsg (const struct msghdr *msg, int flags)
int
fhandler_socket::shutdown (int how)
{
sigframe thisframe (mainthread);
int res = ::shutdown (get_socket (), how);
if (res)
@ -872,8 +856,6 @@ fhandler_socket::close ()
{
int res = 0;
sigframe thisframe (mainthread);
/* HACK to allow a graceful shutdown even if shutdown() hasn't been
called by the application. Note that this isn't the ultimate
solution but it helps in many cases. */
@ -916,8 +898,6 @@ fhandler_socket::ioctl (unsigned int cmd, void *p)
struct ifconf ifc, *ifcp;
struct ifreq *ifr, *ifrp;
sigframe thisframe (mainthread);
switch (cmd)
{
case SIOCGIFCONF:

View File

@ -20,11 +20,14 @@ details. */
#include "path.h"
#include "dtable.h"
#include "cygheap.h"
#include "sigproc.h"
#include <sys/termios.h>
extern "C" int
ioctl (int fd, int cmd, ...)
{
sigframe thisframe (mainthread);
cygheap_fdget cfd (fd);
if (cfd < 0)
return -1;

View File

@ -568,6 +568,8 @@ cygwin_sendto (int fd, const void *buf, int len, int flags,
const struct sockaddr *to, int tolen)
{
int res;
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
if ((len && __check_invalid_read_ptr_errno (buf, (unsigned) len))
@ -589,6 +591,8 @@ cygwin_recvfrom (int fd, void *buf, int len, int flags,
struct sockaddr *from, int *fromlen)
{
int res;
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
if ((len && __check_null_invalid_struct_errno (buf, (unsigned) len))
@ -742,6 +746,8 @@ extern "C" int
cygwin_connect (int fd, const struct sockaddr *name, int namelen)
{
int res;
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
if (__check_invalid_read_ptr_errno (name, namelen) || !fh)
@ -1002,6 +1008,8 @@ extern "C" int
cygwin_accept (int fd, struct sockaddr *peer, int *len)
{
int res;
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
if ((peer && (check_null_invalid_struct_errno (len)
@ -1011,7 +1019,7 @@ cygwin_accept (int fd, struct sockaddr *peer, int *len)
else
res = fh->accept (peer, len);
syscall_printf ("%d = accept (%d, %p, %d)", res, fd, peer, len);
syscall_printf ("%d = accept (%d, %p, %p)", res, fd, peer, len);
return res;
}
@ -1036,6 +1044,8 @@ extern "C" int
cygwin_getsockname (int fd, struct sockaddr *addr, int *namelen)
{
int res;
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
if (check_null_invalid_struct_errno (namelen)
@ -1045,7 +1055,7 @@ cygwin_getsockname (int fd, struct sockaddr *addr, int *namelen)
else
res = fh->getsockname (addr, namelen);
syscall_printf ("%d = getsockname (%d, %p, %d)", res, fd, addr, namelen);
syscall_printf ("%d = getsockname (%d, %p, %p)", res, fd, addr, namelen);
return res;
}
@ -1070,6 +1080,8 @@ extern "C" int
cygwin_shutdown (int fd, int how)
{
int res;
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
if (!fh)
@ -1133,6 +1145,8 @@ extern "C" int
cygwin_getpeername (int fd, struct sockaddr *name, int *len)
{
int res;
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
if (check_null_invalid_struct_errno (len)
@ -2087,6 +2101,8 @@ extern "C" int
cygwin_recvmsg (int fd, struct msghdr *msg, int flags)
{
int res;
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
if (check_null_invalid_struct_errno (msg)
@ -2098,7 +2114,7 @@ cygwin_recvmsg (int fd, struct msghdr *msg, int flags)
else
res = fh->recvmsg (msg, flags);
syscall_printf ("%d = recvmsg (%d, %p, %d)", res, fd, msg, flags);
syscall_printf ("%d = recvmsg (%d, %p, %x)", res, fd, msg, flags);
return res;
}
@ -2118,6 +2134,6 @@ cygwin_sendmsg (int fd, const struct msghdr *msg, int flags)
else
res = fh->sendmsg (msg, flags);
syscall_printf ("%d = recvmsg (%d, %p, %d)", res, fd, msg, flags);
syscall_printf ("%d = sendmsg (%d, %p, %x)", res, fd, msg, flags);
return res;
}