summaryrefslogtreecommitdiff
path: root/x11/xmindpath/patches/patch-ac
blob: 682be778c09f15d9732936058fb0d3d6bedc1f2d (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
42
43
44
$NetBSD: patch-ac,v 1.1 2007/10/01 11:02:45 rillig Exp $

--- uucplock.c.orig	1999-12-02 03:58:31.000000000 +0100
+++ uucplock.c	2007-10-01 12:47:24.989964000 +0200
@@ -35,9 +35,13 @@
 static char sccsid[] = "@(#)uucplock.c	5.5 (Berkeley) 6/1/90";
 #endif /* not lint */
 
-#include <sys/file.h>
-#include <sys/dir.h>
+#include <dirent.h>
 #include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
 
 #include "pathnames.h"
 
@@ -47,13 +51,12 @@ static char sccsid[] = "@(#)uucplock.c	5
  * 	  -1 - failure
  */
 
+int
 uu_lock(ttyname)
 	char *ttyname;
 {
-	extern int errno;
 	int fd, pid;
 	char tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN];
-	off_t lseek();
 
 	(void)snprintf(tbuf, sizeof(tbuf), _PATH_LOCKDIRNAME, ttyname);
 	fd = open(tbuf, O_RDWR|O_CREAT|O_EXCL, 0664);
@@ -81,7 +84,7 @@ uu_lock(ttyname)
 		 * The process that locked the file isn't running, so
 		 * we'll lock it ourselves
 		 */
-		if (lseek(fd, 0L, L_SET) < 0) {
+		if (lseek(fd, 0L, SEEK_SET) < 0) {
 			(void)close(fd);
 			perror("lock lseek");
 			return(-1);