blob: 3bf70dff1f9bbdbe5eb5cb2e412b629a844b6efb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
$NetBSD: patch-ae,v 1.2 2000/10/13 18:59:31 jwise Exp $
--- tnmUnixSocket.c.orig Wed Sep 18 23:37:21 1996
+++ tnmUnixSocket.c Mon Oct 2 21:07:45 2000
@@ -13,6 +13,8 @@
#include "tnmInt.h"
#include "tnmPort.h"
+#include <fcntl.h>
+
int
TnmSocket(domain, type, protocol)
int domain;
@@ -20,7 +22,13 @@
int protocol;
{
int s = socket(domain, type, protocol);
- return (s < 0) ? TNM_SOCKET_ERROR : s;
+ if (s < 0) {
+ return TNM_SOCKET_ERROR;
+ }
+#ifdef O_NONBLOCK
+ fcntl(s, F_SETFL, O_NONBLOCK);
+#endif
+ return s;
}
int
|