diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-06-24 21:28:39 +0200 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-06-24 21:28:39 +0200 |
commit | 64b24cd8a5ea87bccec60e0236d93071480201e7 (patch) | |
tree | 700881d697971bca0b9715942411e13f0f90bbf6 /engines | |
parent | 4d94c275d2344b9231d9dc4585bd42b8e9fb7794 (diff) | |
download | fio-64b24cd8a5ea87bccec60e0236d93071480201e7.tar.gz |
net engine: fix listenfd/pipe fd leaks
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'engines')
-rw-r--r-- | engines/net.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/net.c b/engines/net.c index bc3946d5..4538a04d 100644 --- 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; } |