projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
install-reloc: Support multi-binary installation.
[gnulib.git]
/
lib
/
accept.c
diff --git
a/lib/accept.c
b/lib/accept.c
index
5591fa5
..
bf27403
100644
(file)
--- a/
lib/accept.c
+++ b/
lib/accept.c
@@
-1,6
+1,6
@@
/* accept.c --- wrappers for Windows accept function
/* accept.c --- wrappers for Windows accept function
- Copyright (C) 2008-201
1
Free Software Foundation, Inc.
+ Copyright (C) 2008-201
3
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-31,12
+31,22
@@
int
rpl_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
{
int
rpl_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
{
- SOCKET fh = accept (FD_TO_SOCKET (fd), addr, addrlen);
- if (fh == INVALID_SOCKET)
+ SOCKET sock = FD_TO_SOCKET (fd);
+
+ if (sock == INVALID_SOCKET)
{
{
-
set_winsock_errno ()
;
+
errno = EBADF
;
return -1;
}
else
return -1;
}
else
- return SOCKET_TO_FD (fh);
+ {
+ SOCKET fh = accept (sock, addr, addrlen);
+ if (fh == INVALID_SOCKET)
+ {
+ set_winsock_errno ();
+ return -1;
+ }
+ else
+ return SOCKET_TO_FD (fh);
+ }
}
}