45 lines
1.1 KiB
Plaintext
45 lines
1.1 KiB
Plaintext
$NetBSD: patch-aa,v 1.2 2012/03/01 19:44:42 hans Exp $
|
|
|
|
--- ../src/uucplock.c.orig 2005-12-18 23:25:20.000000000 +0000
|
|
+++ ../src/uucplock.c
|
|
@@ -38,8 +38,12 @@ static char sccsid[] = "@(#)uucplock.c 5
|
|
#include "config.h"
|
|
|
|
#include <sys/file.h>
|
|
-#include <sys/dir.h>
|
|
+#include <dirent.h>
|
|
#include <errno.h>
|
|
+#include <limits.h>
|
|
+#include <sys/types.h>
|
|
+#include <sys/stat.h>
|
|
+#include <fcntl.h>
|
|
|
|
#include "pathnames.h"
|
|
|
|
@@ -52,9 +56,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 +111,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));
|