summaryrefslogtreecommitdiff
path: root/comms/snooper/patches/patch-ab
blob: 131e7a88f42793494a4d43e240c097ff29401f17 (plain)
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
39
40
41
$NetBSD: patch-ab,v 1.1 2005/12/27 13:51:27 joerg Exp $

--- src/uucplock.c.orig	2005-12-23 16:22:29.000000000 +0000
+++ src/uucplock.c
@@ -38,8 +38,9 @@ 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 "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));