diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-08-13 19:27:26 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-08-13 19:27:26 +0000 |
commit | 995a8bb393913f9a1f4eb773b70aad7a622b614c (patch) | |
tree | e974f0fd8dd5d7cd4f89b315e0095f282ad85d10 /usr.bin/tmux/job.c | |
parent | f4ce85b1364b19c11d40f304a454df6d2ff5ce87 (diff) |
Add menu options to convert a popup into a pane.
Diffstat (limited to 'usr.bin/tmux/job.c')
-rw-r--r-- | usr.bin/tmux/job.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/usr.bin/tmux/job.c b/usr.bin/tmux/job.c index 1887b2b0942..db67647ef36 100644 --- a/usr.bin/tmux/job.c +++ b/usr.bin/tmux/job.c @@ -1,4 +1,4 @@ -/* $OpenBSD: job.c,v 1.60 2021/03/02 10:56:45 nicm Exp $ */ +/* $OpenBSD: job.c,v 1.61 2021/08/13 19:27:25 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -201,6 +201,27 @@ fail: return (NULL); } +/* Take job's file descriptor and free the job. */ +int +job_transfer(struct job *job) +{ + int fd = job->fd; + + log_debug("transfer job %p: %s", job, job->cmd); + + LIST_REMOVE(job, entry); + free(job->cmd); + + if (job->freecb != NULL && job->data != NULL) + job->freecb(job->data); + + if (job->event != NULL) + bufferevent_free(job->event); + + free(job); + return (fd); +} + /* Kill and free an individual job. */ void job_free(struct job *job) |