projects
/
u
/
mdw
/
putty
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
792c5eb
)
Replace use of FIONBIO with POSIX-approved O_NONBLOCK (set using fcntl()).
author
ben
<ben@cda61777-01e9-0310-a592-d414129be87e>
Wed, 16 Apr 2003 23:58:59 +0000
(23:58 +0000)
committer
ben
<ben@cda61777-01e9-0310-a592-d414129be87e>
Wed, 16 Apr 2003 23:58:59 +0000
(23:58 +0000)
This should save us having to worry about different OSs' defining it in
different headers.
git-svn-id: svn://svn.tartarus.org/sgt/putty@3126
cda61777
-01e9-0310-a592-
d414129be87e
unix/uxnet.c
patch
|
blob
|
blame
|
history
diff --git
a/unix/uxnet.c
b/unix/uxnet.c
index
f4731fd
..
8ae0c2f
100644
(file)
--- a/
unix/uxnet.c
+++ b/
unix/uxnet.c
@@
-383,6
+383,7
@@
Socket sk_new(SockAddr addr, int port, int privport, int oobinline,
int err;
Actual_Socket ret;
short localport;
+ int fl;
/*
* Create Socket structure.
@@
-492,10
+493,10
@@
Socket sk_new(SockAddr addr, int port, int privport, int oobinline,
a.sin_addr.s_addr = htonl(addr->address);
a.sin_port = htons((short) port);
#endif
- {
-
int i = 1
;
- ioctl(s, FIONBIO, &i);
- }
+
+
fl = fcntl(s, F_GETFL)
;
+ if (fl != -1)
+ fcntl(s, F_SETFL, fl | O_NONBLOCK);
if ((
#ifdef IPV6