Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/lpr/lpd If we exit because the pid file is locked, ...



details:   https://anonhg.NetBSD.org/src/rev/561db2dc3e74
branches:  trunk
changeset: 536646:561db2dc3e74
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Thu Sep 19 20:22:32 2002 +0000

description:
If we exit because the pid file is locked, syslog that.

diffstat:

 usr.sbin/lpr/lpd/lpd.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r bb748f2a7e8f -r 561db2dc3e74 usr.sbin/lpr/lpd/lpd.c
--- a/usr.sbin/lpr/lpd/lpd.c    Thu Sep 19 20:08:58 2002 +0000
+++ b/usr.sbin/lpr/lpd/lpd.c    Thu Sep 19 20:22:32 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lpd.c,v 1.39 2002/09/19 20:08:58 mycroft Exp $ */
+/*     $NetBSD: lpd.c,v 1.40 2002/09/19 20:22:32 mycroft Exp $ */
 
 /*
  * Copyright (c) 1983, 1993, 1994
@@ -45,7 +45,7 @@
 #if 0
 static char sccsid[] = "@(#)lpd.c      8.7 (Berkeley) 5/10/95";
 #else
-__RCSID("$NetBSD: lpd.c,v 1.39 2002/09/19 20:08:58 mycroft Exp $");
+__RCSID("$NetBSD: lpd.c,v 1.40 2002/09/19 20:22:32 mycroft Exp $");
 #endif
 #endif /* not lint */
 
@@ -250,8 +250,11 @@
                exit(1);
        }
        if (flock(lfd, LOCK_EX|LOCK_NB) < 0) {
-               if (errno == EWOULDBLOCK)       /* active daemon present */
+               if (errno == EWOULDBLOCK) {     /* active daemon present */
+                       syslog(LOG_ERR, "%s is locked; another lpd is running",
+                           _PATH_MASTERLOCK);
                        exit(0);
+               }
                syslog(LOG_ERR, "%s: %m", _PATH_MASTERLOCK);
                exit(1);
        }



Home | Main Index | Thread Index | Old Index