=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/job.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/usr.bin/tmux/job.c 2009/10/10 18:42:14 1.2 +++ src/usr.bin/tmux/job.c 2009/10/11 07:20:16 1.3 @@ -1,4 +1,4 @@ -/* $OpenBSD: job.c,v 1.2 2009/10/10 18:42:14 nicm Exp $ */ +/* $OpenBSD: job.c,v 1.3 2009/10/11 07:20:16 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -105,6 +105,8 @@ job->freefn = freefn; job->data = data; + job->flags = JOB_DONE; + RB_INSERT(jobs, jobs, job); SLIST_INSERT_HEAD(&all_jobs, job, lentry); @@ -133,8 +135,9 @@ { int nullfd, out[2], mode; - if (job->fd != -1) + if (!(job->flags & JOB_DONE)) return (0); + job->flags &= ~JOB_DONE; if (pipe(out) != 0) return (-1);