From 02773fa0296ed51b76e158c5712558724e6567d7 Mon Sep 17 00:00:00 2001 From: ache Date: Wed, 20 Sep 1995 13:10:50 +0000 Subject: Use new _PATH_LOCK for lock names --- sbin/startslip/uucplock.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'sbin/startslip') 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 #include #include +#include -#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)); } -- cgit v1.1