summaryrefslogtreecommitdiffstats
path: root/job.c
diff options
context:
space:
mode:
authornicm <nicm>2021-08-13 19:27:25 +0000
committernicm <nicm>2021-08-13 19:27:25 +0000
commit2588c3e52e24a8726ac3d1277ede6ddf07dd6257 (patch)
treedf54c35da82cc053338d84ae69fd9d206eae69a7 /job.c
parent92615b534a887980ac7b52ca8322b6947cd1a47d (diff)
Add menu options to convert a popup into a pane.
Diffstat (limited to 'job.c')
-rw-r--r--job.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/job.c b/job.c
index a972bc0e..adad71e9 100644
--- a/job.c
+++ b/job.c
@@ -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)