diff options
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/atrun/atrun.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libexec/atrun/atrun.c b/libexec/atrun/atrun.c index 594107e..1e25766 100644 --- a/libexec/atrun/atrun.c +++ b/libexec/atrun/atrun.c @@ -567,6 +567,12 @@ main(int argc, char *argv[]) if (run_batch && (gloadavg() < load_avg)) run_file(batch_name, batch_uid, batch_gid); + if (flock(dirfd(spool), LOCK_UN) == -1) + perr("cannot unlock %s", ATJOB_DIR); + + if (closedir(spool) == -1) + perr("cannot closedir %s", ATJOB_DIR); + closelog(); exit(EXIT_SUCCESS); } |