Fix various prototypes and missing inclueds.

This commit is contained in:
joerg 2013-05-23 14:57:32 +00:00
parent c7c4dc01b8
commit 3c4b46a05b
16 changed files with 255 additions and 3 deletions

View file

@ -1,6 +1,20 @@
$NetBSD: distinfo,v 1.3 2010/03/20 01:51:40 schmonz Exp $
$NetBSD: distinfo,v 1.4 2013/05/23 14:57:32 joerg Exp $
SHA1 (publicfile-0.52.tar.gz) = 067e5a0c57bf8ac04c578cac47bd80c2d88eddeb
RMD160 (publicfile-0.52.tar.gz) = 02d2bff245e9d474f26ac29a96775c8eeed0799c
Size (publicfile-0.52.tar.gz) = 34892 bytes
SHA1 (patch-aa) = e9933a7337b4fa6683fb6c11a6421bfa6e6962eb
SHA1 (patch-Makefile) = e9933a7337b4fa6683fb6c11a6421bfa6e6962eb
SHA1 (patch-alloc.c) = 3a8491e1f15595cafba1406e22d282fdb1734365
SHA1 (patch-exit.h) = cff7aa714c2dcfa95f3663af12a3e26013a4d391
SHA1 (patch-fetch.c) = fc10297708df10817eff97927d1fc2f05acbaff0
SHA1 (patch-file.c) = 15a9db2b4225ccbe935a71a3515553b1f9731af8
SHA1 (patch-filetype.c) = 87e2fa25e92c41fa0ce84c8cd7549ba83f00f4b0
SHA1 (patch-ftpd.c) = 90755132891cf6b36a5e0a5c589b6c11857dfeec
SHA1 (patch-httpd.c) = 4fa3d55ea17b2a626109da2c84a60a6c5f9b8972
SHA1 (patch-leapsecs__read.c) = b956b8983d7a680b0349d9f99551a6480a1f664b
SHA1 (patch-main.c) = abe752e15212ee4f191de4e56256d7e137cfb184
SHA1 (patch-open.h) = 4605a65b282d013c71a02128df3c297a259cfa16
SHA1 (patch-prot.c) = 35c0fdce5b121f5b17b8cb4a288f4d43b8e8e197
SHA1 (patch-prot.h) = 6c47e387dbc9c9bc59f53a84e2112fadd6836118
SHA1 (patch-readwrite.h) = e6f17cddb9673ebb4a458c557215c28526712501
SHA1 (patch-utime.c) = cd4b3414200c190cec781d00cf36267e2a0b4208

View file

@ -1,4 +1,4 @@
$NetBSD: patch-aa,v 1.1 2010/03/20 01:51:40 schmonz Exp $
$NetBSD: patch-Makefile,v 1.1 2013/05/23 14:57:32 joerg Exp $
--- Makefile.orig 1999-11-09 07:23:46.000000000 +0000
+++ Makefile

View file

@ -0,0 +1,13 @@
$NetBSD: patch-alloc.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
--- alloc.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ alloc.c
@@ -1,7 +1,6 @@
#include "alloc.h"
#include "error.h"
-extern char *malloc();
-extern void free();
+#include <stdlib.h>
#define ALIGNMENT 16 /* XXX: assuming that this alignment is enough */
#define SPACE 4096 /* must be multiple of ALIGNMENT */

View file

@ -0,0 +1,13 @@
$NetBSD: patch-exit.h,v 1.1 2013/05/23 14:57:32 joerg Exp $
--- exit.h.orig 1999-11-09 07:23:46.000000000 +0000
+++ exit.h
@@ -1,6 +1,7 @@
#ifndef EXIT_H
#define EXIT_H
-extern void _exit();
+#include <stdlib.h>
+#include <unistd.h>
#endif

View file

@ -0,0 +1,39 @@
$NetBSD: patch-fetch.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
--- fetch.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ fetch.c
@@ -8,6 +8,8 @@
#include "direntry.h"
#include "fmt.h"
#include "fetch.h"
+#include "readwrite.h"
+#include "open.h"
int fetch_ascii = 1;
unsigned long fetch_rest = 0;
@@ -75,14 +77,14 @@ static void list(char *fn,int flaglong)
if (error_temp(errno)) _exit(23);
return;
}
- printstat(&st);
+ printstat();
}
substdio_puts(&ss,fn);
substdio_puts(&ss,"\r\n");
}
-static int doit(char *fn,int fddata,int fdfile,int how)
+static void doit(char *fn,int fddata,int fdfile,int how)
{
DIR *dir;
direntry *d;
@@ -94,7 +96,7 @@ static int doit(char *fn,int fddata,int
switch(how) {
case FETCH_LISTONE:
if (fstat(fdfile,&st) == -1) break;
- printstat(&st);
+ printstat();
for (i = 0;fn[i];++i)
if (fn[i] == '\n')
substdio_put(&ss,"",1);

View file

@ -0,0 +1,13 @@
$NetBSD: patch-file.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
--- file.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ file.c
@@ -7,6 +7,8 @@
#include "str.h"
#include "tai.h"
#include "env.h"
+#include "open.h"
+#include "exit.h"
static void log(char *fn,char *result1,char *result2,int flagread)
{

View file

@ -0,0 +1,11 @@
$NetBSD: patch-filetype.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
--- filetype.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ filetype.c
@@ -1,5 +1,6 @@
#include "filetype.h"
#include "str.h"
+#include "exit.h"
void filetype(char *fn,stralloc *contenttype)
{

View file

@ -0,0 +1,12 @@
$NetBSD: patch-ftpd.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
--- ftpd.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ ftpd.c
@@ -7,6 +7,7 @@
#include "timeoutread.h"
#include "timeoutwrite.h"
#include "substdio.h"
+#include "exit.h"
#include "fetch.h"
#include "pathdecode.h"
#include "file.h"

View file

@ -0,0 +1,26 @@
$NetBSD: patch-httpd.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
--- httpd.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ httpd.c
@@ -1,3 +1,4 @@
+#include <sys/socket.h>
#include "pathdecode.h"
#include "file.h"
#include "filetype.h"
@@ -15,6 +16,7 @@
#include "substdio.h"
#include "error.h"
#include "getln.h"
+#include "byte.h"
int safewrite(int fd,char *buf,int len)
{
@@ -209,7 +211,7 @@ void readline(void)
if (line.len && (line.s[line.len - 1] == '\r')) --line.len;
}
-void doit()
+void doit(void)
{
int i;
int spaces;

View file

@ -0,0 +1,16 @@
$NetBSD: patch-leapsecs__read.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
--- leapsecs_read.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ leapsecs_read.c
@@ -1,8 +1,10 @@
+#include <unistd.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
-extern int errno;
+#include <errno.h>
#include "tai.h"
#include "leapsecs.h"

View file

@ -0,0 +1,11 @@
$NetBSD: patch-main.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
--- main.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ main.c
@@ -1,5 +1,6 @@
#include "env.h"
#include "exit.h"
+#include "prot.h"
#include "scan.h"
extern void doit(void);

View file

@ -0,0 +1,17 @@
$NetBSD: patch-open.h,v 1.1 2013/05/23 14:57:32 joerg Exp $
--- open.h.orig 1999-11-09 07:23:46.000000000 +0000
+++ open.h
@@ -1,10 +1,7 @@
#ifndef OPEN_H
#define OPEN_H
-extern int open_read();
-extern int open_excl();
-extern int open_append();
-extern int open_trunc();
-extern int open_write();
+extern int open_read(char *);
+extern int open_trunc(char *);
#endif

View file

@ -0,0 +1,25 @@
$NetBSD: patch-prot.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
--- prot.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ prot.c
@@ -1,9 +1,10 @@
#include "hasshsgr.h"
#include "prot.h"
+#include <unistd.h>
/* XXX: there are more portability problems here waiting to leap out at me */
-int prot_gid(gid) int gid;
+int prot_gid(gid_t gid)
{
#ifdef HASSHORTSETGROUPS
short x[2];
@@ -15,7 +16,7 @@ int prot_gid(gid) int gid;
return setgid(gid); /* _should_ be redundant, but on some systems it isn't */
}
-int prot_uid(uid) int uid;
+int prot_uid(uid_t uid)
{
return setuid(uid);
}

View file

@ -0,0 +1,15 @@
$NetBSD: patch-prot.h,v 1.1 2013/05/23 14:57:32 joerg Exp $
--- prot.h.orig 1999-11-09 07:23:46.000000000 +0000
+++ prot.h
@@ -1,7 +1,8 @@
#ifndef PROT_H
#define PROT_H
-extern int prot_gid();
-extern int prot_uid();
+#include <unistd.h>
+extern int prot_gid(gid_t);
+extern int prot_uid(uid_t);
#endif

View file

@ -0,0 +1,16 @@
$NetBSD: patch-readwrite.h,v 1.1 2013/05/23 14:57:32 joerg Exp $
--- readwrite.h.orig 1999-11-09 07:23:46.000000000 +0000
+++ readwrite.h
@@ -1,7 +1,9 @@
#ifndef READWRITE_H
#define READWRITE_H
-extern int read();
-extern int write();
+#include <sys/stat.h>
+#include <unistd.h>
+
+void out_puts(char *s);
#endif

View file

@ -0,0 +1,11 @@
$NetBSD: patch-utime.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
--- utime.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ utime.c
@@ -1,5 +1,6 @@
#include <sys/types.h>
#include <sys/time.h>
+#include <utime.h>
#include "scan.h"
#include "exit.h"