projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4d94c27
)
net engine: fix listenfd/pipe fd leaks
author
Jens Axboe
<jens.axboe@oracle.com>
Sun, 24 Jun 2007 19:28:39 +0000
(21:28 +0200)
committer
Jens Axboe
<jens.axboe@oracle.com>
Sun, 24 Jun 2007 19:28:39 +0000
(21:28 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
engines/net.c
patch
|
blob
|
blame
|
history
diff --git
a/engines/net.c
b/engines/net.c
index bc3946d588f4c389d448ca4c3c36cb1d4c1d0b84..4538a04d3d829dcf22dfa5f5ba6b5ed429dc96f0 100644
(file)
--- a/
engines/net.c
+++ b/
engines/net.c
@@
-424,6
+424,13
@@
static void fio_netio_cleanup(struct thread_data *td)
struct netio_data *nd = td->io_ops->data;
if (nd) {
+ if (nd->listenfd != -1)
+ close(nd->listenfd);
+ if (nd->pipes[0] != -1)
+ close(nd->pipes[0]);
+ if (nd->pipes[1] != -1)
+ close(nd->pipes[1]);
+
free(nd);
td->io_ops->data = NULL;
}
@@
-438,6
+445,7
@@
static int fio_netio_setup(struct thread_data *td)
memset(nd, 0, sizeof(*nd));
nd->listenfd = -1;
+ nd->pipes[0] = nd->pipes[1] = -1;
td->io_ops->data = nd;
}