summaryrefslogtreecommitdiff
path: root/databases/sdbm/patches/patch-aa
blob: 7dac558a992d917c2c0e98b491c0871b092d7e59 (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
$NetBSD: patch-aa,v 1.4 2004/04/28 00:20:22 minskim Exp $

--- sdbm.c.orig	2004-04-27 19:10:43.000000000 -0500
+++ sdbm.c
@@ -25,6 +25,10 @@ static char rcsid[] = "$Id: sdbm.c,v 1.1
 #endif
 #include <errno.h>
 #include <string.h>
+#include <stdlib.h>
+
+/* To define SEEK_SET on Linux */
+#include <stdio.h>
 
 #ifdef __STDC__
 #include <stddef.h>
@@ -35,17 +39,6 @@ static char rcsid[] = "$Id: sdbm.c,v 1.1
 #endif
 
 /*
- * externals
- */
-#ifndef sun
-extern int errno;
-#endif
-
-extern char *malloc proto((unsigned int));
-extern void free proto((void *));
-extern long lseek();
-
-/*
  * forward
  */
 static int getdbit proto((DBM *, long));
@@ -95,7 +88,7 @@ register int mode;
  */
 	n = strlen(file) * 2 + strlen(DIRFEXT) + strlen(PAGFEXT) + 2;
 
-	if ((dirname = malloc((unsigned) n)) == NULL)
+	if ((dirname = (char *) malloc(n)) == NULL)
 		return errno = ENOMEM, (DBM *) NULL;
 /*
  * build the file names