Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 May 2014 16:52:38 +0000 (UTC)
From:      Guy Helmer <ghelmer@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r265368 - stable/10/libexec/atrun
Message-ID:  <201405051652.s45Gqcdl091674@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ghelmer
Date: Mon May  5 16:52:38 2014
New Revision: 265368
URL: http://svnweb.freebsd.org/changeset/base/265368

Log:
  MFC r264617:
  
  Fix releasing the lock in the parent atrun process after the queue
  directory has been processed. Otherwise, a long-running child process
  caused other atrun invocations to stall unnecessarily.
  
  Submitted by:	J.R. Oldroyd  jr at opal.com

Modified:
  stable/10/libexec/atrun/atrun.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/libexec/atrun/atrun.c
==============================================================================
--- stable/10/libexec/atrun/atrun.c	Mon May  5 16:41:15 2014	(r265367)
+++ stable/10/libexec/atrun/atrun.c	Mon May  5 16:52:38 2014	(r265368)
@@ -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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405051652.s45Gqcdl091674>