Lines 1-7
Link Here
|
1 |
diff -urN nbd-2.8.2.orig/nbd-server.c nbd-2.8.2/nbd-server.c |
1 |
diff -urN nbd-2.8.3.orig/nbd-server.c nbd-2.8.3/nbd-server.c |
2 |
--- nbd-2.8.2.orig/nbd-server.c Wed Nov 9 22:38:44 2005 |
2 |
--- nbd-2.8.3.orig/nbd-server.c Thu Dec 22 21:37:20 2005 |
3 |
+++ nbd-server.c Thu Dec 22 16:04:47 2005 |
3 |
+++ nbd-server.c Sun Jan 8 16:45:30 2006 |
4 |
@@ -363,11 +363,11 @@ |
4 |
@@ -363,12 +363,12 @@ |
5 |
* is severely wrong) |
5 |
* is severely wrong) |
6 |
**/ |
6 |
**/ |
7 |
void sigchld_handler(int s) { |
7 |
void sigchld_handler(int s) { |
Lines 9-26
Link Here
|
9 |
+ int status; |
9 |
+ int status; |
10 |
int* i; |
10 |
int* i; |
11 |
pid_t pid; |
11 |
pid_t pid; |
|
|
12 |
int done=0; |
12 |
|
13 |
|
13 |
- while((pid=wait(status)) > 0) { |
14 |
- while(!done && (pid=wait(status)) > 0) { |
14 |
+ while ((pid = waitpid(-1, &status, WNOHANG)) > 0) { |
15 |
+ while(!done && (pid=wait(&status)) > 0) { |
15 |
if(WIFEXITED(status)) { |
16 |
if(WIFEXITED(status)) { |
16 |
msg3(LOG_INFO, "Child exited with %d", WEXITSTATUS(status)); |
17 |
msg3(LOG_INFO, "Child exited with %d", WEXITSTATUS(status)); |
17 |
} |
18 |
msg3(LOG_INFO, "pid is %d", pid); |
18 |
@@ -684,7 +684,7 @@ |
|
|
19 |
|
20 |
if (request.magic != htonl(NBD_REQUEST_MAGIC)) |
21 |
err("Not enough magic."); |
22 |
- if (len > BUFSIZE) |
23 |
+ if (len > (BUFSIZE-sizeof(struct nbd_reply))) |
24 |
err("Request too big!"); |
25 |
#ifdef DODBG |
26 |
printf("%s from %Lu (%Lu) len %d, ", request.type ? "WRITE" : |