From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 16:00:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B74D30A; Thu, 17 Apr 2014 16:00:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28DA110E8; Thu, 17 Apr 2014 16:00:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HG0Ri9019251; Thu, 17 Apr 2014 16:00:27 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HG0Rvf019250; Thu, 17 Apr 2014 16:00:27 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201404171600.s3HG0Rvf019250@svn.freebsd.org> From: Guy Helmer Date: Thu, 17 Apr 2014 16:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264617 - head/libexec/atrun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 16:00:27 -0000 Author: ghelmer Date: Thu Apr 17 16:00:26 2014 New Revision: 264617 URL: http://svnweb.freebsd.org/changeset/base/264617 Log: 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. Modified: head/libexec/atrun/atrun.c Modified: head/libexec/atrun/atrun.c ============================================================================== --- head/libexec/atrun/atrun.c Thu Apr 17 15:44:21 2014 (r264616) +++ head/libexec/atrun/atrun.c Thu Apr 17 16:00:26 2014 (r264617) @@ -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); }