summaryrefslogtreecommitdiff
path: root/ot_socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'ot_socket.c')
-rw-r--r--ot_socket.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/ot_socket.c b/ot_socket.c
index c73738c..158459f 100644
--- a/ot_socket.c
+++ b/ot_socket.c
@@ -9,7 +9,6 @@
9#include <netinet/in.h> 9#include <netinet/in.h>
10#include <string.h> 10#include <string.h>
11#include <sys/socket.h> 11#include <sys/socket.h>
12#include <sys/time.h>
13#include <unistd.h> 12#include <unistd.h>
14 13
15/* Opentracker */ 14/* Opentracker */
@@ -49,12 +48,6 @@ int socket_set_blocking(int s, int blocking) {
49 return fcntl(s, F_SETFL, blocking ? (flags & ~O_NONBLOCK) : (flags | O_NONBLOCK)); 48 return fcntl(s, F_SETFL, blocking ? (flags & ~O_NONBLOCK) : (flags | O_NONBLOCK));
50} 49}
51 50
52int socket_set_timeout(int s, int seconds) {
53 struct timeval patience = {seconds, 0};
54
55 return setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &patience, sizeof(patience));
56}
57
58static int set_nonblocking(int s) { return socket_set_blocking(s, 0); } 51static int set_nonblocking(int s) { return socket_set_blocking(s, 0); }
59 52
60/* Close without letting the failure we are about to report be overwritten */ 53/* Close without letting the failure we are about to report be overwritten */