1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
$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));
|