Version: 1
-Previous: 388f7d20705552d7325ca05797173332ddc5ac9f
-Head: 23c2fdce4b79eadd6386c5e73329000965696771
+Previous: 5a98170a18d3b302a1158e0f5b971093a4d24394
+Head: e633944d0a9d3a680904ab64fa1b092861b8e6d9
Applied:
- test-udp: 06e4f5c6a47b827c226ad6a25143d59809a422e2
- refresh-temp: 23c2fdce4b79eadd6386c5e73329000965696771
+ test-udp: e633944d0a9d3a680904ab64fa1b092861b8e6d9
Unapplied:
usocket: 158ea5a8c1a0fcf3ca61c642095023af16759c90
iom-dbg: 88434072d07f8edc58f454ac954d78bd39441eed
+++ /dev/null
-Bottom: 92d2aab8615c3d1003fee963587c4078b732e465
-Top: 3bb2d5c4840cc0d59a5a500ba614c6001a92dc00
-Author: Sean Hefty <sean.hefty@intel.com>
-Date: 2012-11-15 21:13:02 -0800
-
-Refresh of test-udp
-
----
-
-diff --git a/src/preload.c b/src/preload.c
-index fb2149b..2d44848 100644
---- a/src/preload.c
-+++ b/src/preload.c
-@@ -120,6 +120,7 @@ struct fd_info {
- int fd;
- int dupfd;
- atomic_t refcnt;
-+ int udp_fd;
- };
-
- static int fd_open(void)
-@@ -131,7 +132,7 @@ static int fd_open(void)
- if (!fdi)
- return ERR(ENOMEM);
-
-- index = open("/dev/null", O_RDONLY);
-+ index = real.socket(PF_INET, SOCK_DGRAM, 0);//open("/dev/null", O_RDONLY);
- if (index < 0) {
- ret = index;
- goto err1;
-@@ -437,6 +438,7 @@ real:
- int bind(int socket, const struct sockaddr *addr, socklen_t addrlen)
- {
- int fd;
-+ real.bind(socket, addr, addrlen);
- return (fd_get(socket, &fd) == fd_rsocket) ?
- rbind(fd, addr, addrlen) : real.bind(fd, addr, addrlen);
- }
-@@ -657,6 +659,9 @@ int connect(int socket, const struct sockaddr *addr, socklen_t addrlen)
- ssize_t recv(int socket, void *buf, size_t len, int flags)
- {
- int fd;
-+ struct sockaddr sa;
-+ socklen_t len = sizeof sa;
-+ real.recvfrom(socket, buf, len, flags, &sa, &len);
- return (fd_fork_get(socket, &fd) == fd_rsocket) ?
- rrecv(fd, buf, len, flags) : real.recv(fd, buf, len, flags);
- }
-@@ -770,6 +775,7 @@ use_rpoll:
- rfds[i].fd = fd_getd(fds[i].fd);
- rfds[i].events = fds[i].events;
- rfds[i].revents = 0;
-+ real.poll(&fds[i], 1, timeout);
- }
-
- ret = rpoll(rfds, nfds, timeout);
-@@ -957,6 +963,7 @@ int fcntl(int socket, int cmd, ... /* arg */)
- lparam = va_arg(args, long);
- ret = (fd_get(socket, &fd) == fd_rsocket) ?
- rfcntl(fd, cmd, lparam) : real.fcntl(fd, cmd, lparam);
-+ real.fcntl(fd, cmd, lparam);
- break;
- default:
- pparam = va_arg(args, void *);
Bottom: 92d2aab8615c3d1003fee963587c4078b732e465
-Top: 92d2aab8615c3d1003fee963587c4078b732e465
+Top: 3bb2d5c4840cc0d59a5a500ba614c6001a92dc00
Author: Sean Hefty <sean.hefty@intel.com>
Date: 2012-11-15 20:55:33 -0800
---
-
+diff --git a/src/preload.c b/src/preload.c
+index fb2149b..2d44848 100644
+--- a/src/preload.c
++++ b/src/preload.c
+@@ -120,6 +120,7 @@ struct fd_info {
+ int fd;
+ int dupfd;
+ atomic_t refcnt;
++ int udp_fd;
+ };
+
+ static int fd_open(void)
+@@ -131,7 +132,7 @@ static int fd_open(void)
+ if (!fdi)
+ return ERR(ENOMEM);
+
+- index = open("/dev/null", O_RDONLY);
++ index = real.socket(PF_INET, SOCK_DGRAM, 0);//open("/dev/null", O_RDONLY);
+ if (index < 0) {
+ ret = index;
+ goto err1;
+@@ -437,6 +438,7 @@ real:
+ int bind(int socket, const struct sockaddr *addr, socklen_t addrlen)
+ {
+ int fd;
++ real.bind(socket, addr, addrlen);
+ return (fd_get(socket, &fd) == fd_rsocket) ?
+ rbind(fd, addr, addrlen) : real.bind(fd, addr, addrlen);
+ }
+@@ -657,6 +659,9 @@ int connect(int socket, const struct sockaddr *addr, socklen_t addrlen)
+ ssize_t recv(int socket, void *buf, size_t len, int flags)
+ {
+ int fd;
++ struct sockaddr sa;
++ socklen_t len = sizeof sa;
++ real.recvfrom(socket, buf, len, flags, &sa, &len);
+ return (fd_fork_get(socket, &fd) == fd_rsocket) ?
+ rrecv(fd, buf, len, flags) : real.recv(fd, buf, len, flags);
+ }
+@@ -770,6 +775,7 @@ use_rpoll:
+ rfds[i].fd = fd_getd(fds[i].fd);
+ rfds[i].events = fds[i].events;
+ rfds[i].revents = 0;
++ real.poll(&fds[i], 1, timeout);
+ }
+
+ ret = rpoll(rfds, nfds, timeout);
+@@ -957,6 +963,7 @@ int fcntl(int socket, int cmd, ... /* arg */)
+ lparam = va_arg(args, long);
+ ret = (fd_get(socket, &fd) == fd_rsocket) ?
+ rfcntl(fd, cmd, lparam) : real.fcntl(fd, cmd, lparam);
++ real.fcntl(fd, cmd, lparam);
+ break;
+ default:
+ pparam = va_arg(args, void *);