38 lines
973 B
Text
38 lines
973 B
Text
$NetBSD: patch-aa,v 1.1 2005/12/18 23:32:49 joerg Exp $
|
|
|
|
--- ../src/uucplock.c.orig 2005-12-18 23:25:20.000000000 +0000
|
|
+++ ../src/uucplock.c
|
|
@@ -40,6 +40,7 @@ static char sccsid[] = "@(#)uucplock.c 5
|
|
#include <sys/file.h>
|
|
#include <sys/dir.h>
|
|
#include <errno.h>
|
|
+#include <limits.h>
|
|
|
|
#include "pathnames.h"
|
|
|
|
@@ -52,9 +53,12 @@ static char sccsid[] = "@(#)uucplock.c 5
|
|
uu_lock(ttyname)
|
|
char *ttyname;
|
|
{
|
|
- extern int errno;
|
|
int fd, pid;
|
|
+#ifdef NAME_MAX
|
|
+ char tbuf[sizeof(_PATH_LOCKDIRNAME) + NAME_MAX];
|
|
+#else
|
|
char tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN];
|
|
+#endif
|
|
off_t lseek();
|
|
|
|
(void)snprintf(tbuf, sizeof(tbuf), _PATH_LOCKDIRNAME, ttyname);
|
|
@@ -104,7 +108,11 @@ uu_lock(ttyname)
|
|
uu_unlock(ttyname)
|
|
char *ttyname;
|
|
{
|
|
+#ifdef NAME_MAX
|
|
+ char tbuf[sizeof(_PATH_LOCKDIRNAME) + NAME_MAX];
|
|
+#else
|
|
char tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN];
|
|
+#endif
|
|
|
|
(void)snprintf(tbuf, sizeof(tbuf), _PATH_LOCKDIRNAME, ttyname);
|
|
return(unlink(tbuf));
|