summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-09-20 13:10:50 +0000
committerache <ache@FreeBSD.org>1995-09-20 13:10:50 +0000
commit02773fa0296ed51b76e158c5712558724e6567d7 (patch)
treec0b4c980cdd77bd8b3203d0abec7caff7496bb8c /sbin
parent62d89089e7713f75340708072762c2a754ac7f69 (diff)
downloadFreeBSD-src-02773fa0296ed51b76e158c5712558724e6567d7.zip
FreeBSD-src-02773fa0296ed51b76e158c5712558724e6567d7.tar.gz
Use new _PATH_LOCK for lock names
Diffstat (limited to 'sbin')
-rw-r--r--sbin/startslip/uucplock.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sbin/startslip/uucplock.c b/sbin/startslip/uucplock.c
index fb0f7c0..5dffefc 100644
--- a/sbin/startslip/uucplock.c
+++ b/sbin/startslip/uucplock.c
@@ -44,8 +44,9 @@ static char sccsid[] = "@(#)uucplock.c 8.1 (Berkeley) 6/6/93";
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
+#include <paths.h>
-#define _PATH_LOCKDIRNAME "/var/spool/lock/LCK..%s"
+#define LOCKFMT "LCK..%s"
/* Forward declarations */
static int put_pid (int fd, pid_t pid);
@@ -61,9 +62,9 @@ int uu_lock (char *ttyname)
{
int fd;
pid_t pid;
- char tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN];
+ char tbuf[MAXNAMLEN];
- (void)sprintf(tbuf, _PATH_LOCKDIRNAME, ttyname);
+ (void)sprintf(tbuf, _PATH_LOCK LOCKFMT, ttyname);
fd = open(tbuf, O_RDWR|O_CREAT|O_EXCL, 0660);
if (fd < 0) {
/*
@@ -109,9 +110,9 @@ int uu_lock (char *ttyname)
int uu_unlock (char *ttyname)
{
- char tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN];
+ char tbuf[MAXNAMLEN];
- (void)sprintf(tbuf, _PATH_LOCKDIRNAME, ttyname);
+ (void)sprintf(tbuf, _PATH_LOCK LOCKFMT, ttyname);
return(unlink(tbuf));
}
OpenPOWER on IntegriCloud