git://git.onelab.eu
/
vsys-scripts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5d356dc
)
(no commit message)
author
Sapan Bhatia
<sapanb@cs.princeton.edu>
Tue, 24 Mar 2009 18:44:25 +0000
(18:44 +0000)
committer
Sapan Bhatia
<sapanb@cs.princeton.edu>
Tue, 24 Mar 2009 18:44:25 +0000
(18:44 +0000)
fd_bmsocket.c
patch
|
blob
|
history
diff --git
a/fd_bmsocket.c
b/fd_bmsocket.c
index
f9f7c91
..
74d8414
100644
(file)
--- a/
fd_bmsocket.c
+++ b/
fd_bmsocket.c
@@
-2,6
+2,7
@@
#include <sys/socket.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <stdio.h>
+#include <errno.h>
#include "fdpass.h"
unsigned int rcvbuf = 16*1024*1024;
#include "fdpass.h"
unsigned int rcvbuf = 16*1024*1024;
@@
-16,6
+17,14
@@
int main(int argc, char *argv[]) {
sscanf(argv[2],"%d", &control_channel_fd);
magic_socket = socket(AF_INET, SOCK_STREAM, 0);
sscanf(argv[2],"%d", &control_channel_fd);
magic_socket = socket(AF_INET, SOCK_STREAM, 0);
- setsockopt(magic_socket, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(unsigned int));
+
+ if (magic_socket == -1) {
+ printf("Error creating socket: %d\n", errno);
+ exit(1);
+ }
+ if (setsockopt(magic_socket, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(unsigned int))) {
+ printf("Error calling setsockopt: %d\n", errno);
+ exit(1);
+ }
send_fd(control_channel_fd, magic_socket);
}
send_fd(control_channel_fd, magic_socket);
}