aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/daemon.c2
-rw-r--r--src/daemon.h9
2 files changed, 10 insertions, 1 deletions
diff --git a/src/daemon.c b/src/daemon.c
index 56fb682..d262749 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -263,7 +263,7 @@ fail:
* @param hook The hook, `NULL` to run the job.
* @return 0 on success, -1 on error, 1 if the child failed.
*/
-static int
+int
run_job_or_hook(struct job *job, const char *hook)
{
pid_t pid;
diff --git a/src/daemon.h b/src/daemon.h
index 2e402c8..ddb2854 100644
--- a/src/daemon.h
+++ b/src/daemon.h
@@ -179,6 +179,15 @@ int reopen(int fd, int oflag);
int send_string(int sockfd, int outfd, ...);
/**
+ * Run a job or a hook.
+ *
+ * @param job The job.
+ * @param hook The hook, `NULL` to run the job.
+ * @return 0 on success, -1 on error, 1 if the child failed.
+ */
+int run_job_or_hook(struct job *job, const char *hook);
+
+/**
* Removes (and optionally runs) a job.
*
* @param jobno The job number, `NULL` for any job.