summaryrefslogtreecommitdiffstats
path: root/job.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-01-29 02:22:11 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-01-29 02:22:11 +0000
commit9bbc63ed653e6ca73e4eaebd6f52466d53a4da73 (patch)
tree22cfe4ad5f8797aa880320ce52b51868b36e59a6 /job.c
parenta7a44bfcd9f1eeec2b82b6490b35893dcb7c053f (diff)
Call bufferevent_free before closing file descriptor associated with it
or bugs in $EventMechanism on $OtherOS makes libevent get it's knickers in a twist. From Dylan Alex Simon.
Diffstat (limited to 'job.c')
-rw-r--r--job.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/job.c b/job.c
index b167d456..e2e8ab48 100644
--- a/job.c
+++ b/job.c
@@ -124,10 +124,10 @@ job_free(struct job *job)
if (job->pid != -1)
kill(job->pid, SIGTERM);
- if (job->fd != -1)
- close(job->fd);
if (job->event != NULL)
bufferevent_free(job->event);
+ if (job->fd != -1)
+ close(job->fd);
xfree(job);
}