Subject: bin/2551: pppd prints excess "cannot delete pid file" messages
To: None <gnats-bugs@NetBSD.ORG>
From: Kenneth Stailey <kstailey@dol-esa.gov>
List: netbsd-bugs
Date: 06/15/1996 10:22:17
>Number:         2551
>Category:       bin
>Synopsis:       pppd prints excess "cannot delete pid file" messages
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 15 10:35:01 1996
>Last-Modified:
>Originator:     Kenneth Stailey
>Organization:
DOL/ESA/DASM
>Release:        1.2_ALPHA
>Environment:
	
System: NetBSD owl 1.2_ALPHA NetBSD 1.2_ALPHA (OWL) #0: Tue Jun 4 18:56:05 EDT 1996 kstailey@owl:/usr/src/sys/arch/i386/compile/OWL i386


>Description:
	pppd will print "cannot delete pid file" when the real problem is
	that the name of the pid file is an empty string.
>How-To-Repeat:
	forgot.  Try using pppd with configurations that cannot connect
	and do not specify demand dialing.
>Fix:

--- /usr/src/usr.sbin/pppd/main.c	Tue May 14 23:52:47 1996
+++ ./main.c	Wed May 15 00:10:11 1996
@@ -503,7 +503,8 @@
 	}
 
 	if (!demand) {
-	    if (unlink(pidfilename) < 0 && errno != ENOENT) 
+	    if (pidfilename[0] != 0
+		&& unlink(pidfilename) < 0 && errno != ENOENT) 
 		syslog(LOG_WARNING, "unable to delete pid file: %m");
 	    pidfilename[0] = 0;
 	}
>Audit-Trail:
>Unformatted: