diff options
author | Mats O Jansson <maja@cvs.openbsd.org> | 1999-03-27 14:31:24 +0000 |
---|---|---|
committer | Mats O Jansson <maja@cvs.openbsd.org> | 1999-03-27 14:31:24 +0000 |
commit | bdf0fa84baff8b71398e2760eb959d794df83839 (patch) | |
tree | 78765789cde5335291ef0143474ed35b3342c8ec /usr.sbin/mopd/common/file.c | |
parent | 2afff778427a17b38b9ebedd4bb658d36eee20c3 (diff) |
Upgrade to 2.5.4. Mopprobe is working again, and some linux support. -moj
Diffstat (limited to 'usr.sbin/mopd/common/file.c')
-rw-r--r-- | usr.sbin/mopd/common/file.c | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/usr.sbin/mopd/common/file.c b/usr.sbin/mopd/common/file.c index 8a6938255fa..015c4d4187e 100644 --- a/usr.sbin/mopd/common/file.c +++ b/usr.sbin/mopd/common/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.2 1996/09/21 19:11:31 maja Exp $ */ +/* $OpenBSD: file.c,v 1.3 1999/03/27 14:31:21 maja Exp $ */ /* * Copyright (c) 1995-96 Mats O Jansson. All rights reserved. @@ -30,7 +30,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: file.c,v 1.2 1996/09/21 19:11:31 maja Exp $"; +static char rcsid[] = "$OpenBSD: file.c,v 1.3 1999/03/27 14:31:21 maja Exp $"; #endif #include "os.h" @@ -47,6 +47,12 @@ static char rcsid[] = "$OpenBSD: file.c,v 1.2 1996/09/21 19:11:31 maja Exp $"; #if defined(__FreeBSD__) #include <sys/imgact_aout.h> #endif +#if !defined(MID_I386) +#define MID_I386 134 +#endif +#if !defined(MID_SPARC) +#define MID_SPARC 138 +#endif #if !defined(MID_VAX) #define MID_VAX 140 #endif @@ -316,9 +322,6 @@ getMID(old_mid,new_mid) mid = MID_NS32532; break; #endif -/*###323 [cc] for each function it appears in.)%%%*/ -/*###323 [cc] (Each undeclared identifier is reported only once%%%*/ -/*###323 [cc] `MID_SPARC' undeclared (first use this function)%%%*/ case MID_SPARC: mid = MID_SPARC; break; @@ -348,7 +351,7 @@ getMID(old_mid,new_mid) break; #endif default: -/*###352 [cc] syntax error before `}'%%%*/ + break; } return(mid); @@ -403,7 +406,6 @@ getCLBYTES(mid) } #endif -/*###406 [cc] syntax error before `int'%%%*/ int CheckAOutFile(fd) int fd; @@ -414,7 +416,6 @@ CheckAOutFile(fd) struct exec ex, ex_swap; int mid = -1; -/*###416 [cc] `fd' undeclared (first use this function)%%%*/ if (read(fd, (char *)&ex, sizeof(ex)) != sizeof(ex)) return(-1); @@ -439,7 +440,6 @@ CheckAOutFile(fd) #endif NOAOUT } -/*###440 [cc] syntax error before `int'%%%*/ int GetAOutFileInfo(fd, load, xfr, a_text, a_text_fill, a_data, a_data_fill, a_bss, a_bss_fill, aout) @@ -525,7 +525,7 @@ GetAOutFileInfo(fd, load, xfr, a_text, a_text_fill, ex.a_drsize= mopFileGetBX((u_char *)&ex_swap, 28, 4); break; default: -/*###525 [cc] syntax error before `}'%%%*/ + break; } #ifdef INFO @@ -609,22 +609,18 @@ GetAOutFileInfo(fd, load, xfr, a_text, a_text_fill, clbytes = getCLBYTES(mid); clofset = clbytes - 1; -/*###608 [cc] `load' undeclared (first use this function)%%%*/ if (load != NULL) { *load = 0; } -/*###612 [cc] `xfr' undeclared (first use this function)%%%*/ if (xfr != NULL) { *xfr = ex.a_entry; } -/*###616 [cc] `a_text' undeclared (first use this function)%%%*/ if (a_text != NULL) { *a_text = ex.a_text; } -/*###620 [cc] `a_text_fill' undeclared (first use this function)%%%*/ if (a_text_fill != NULL) { if (magic == ZMAGIC || magic == NMAGIC) { *a_text_fill = clbytes - (ex.a_text & clofset); @@ -636,12 +632,10 @@ GetAOutFileInfo(fd, load, xfr, a_text, a_text_fill, } } -/*###631 [cc] `a_data' undeclared (first use this function)%%%*/ if (a_data != NULL) { *a_data = ex.a_data; } -/*###635 [cc] `a_data_fill' undeclared (first use this function)%%%*/ if (a_data_fill != NULL) { if (magic == ZMAGIC || magic == NMAGIC) { *a_data_fill = clbytes - (ex.a_data & clofset); @@ -653,12 +647,10 @@ GetAOutFileInfo(fd, load, xfr, a_text, a_text_fill, } } -/*###646 [cc] `a_bss' undeclared (first use this function)%%%*/ if (a_bss != NULL) { *a_bss = ex.a_bss; } -/*###650 [cc] `a_bss_fill' undeclared (first use this function)%%%*/ if (a_bss_fill != NULL) { if (magic == ZMAGIC || magic == NMAGIC) { *a_bss_fill = clbytes - (ex.a_bss & clofset); @@ -674,7 +666,6 @@ GetAOutFileInfo(fd, load, xfr, a_text, a_text_fill, } } -/*###665 [cc] `aout' undeclared (first use this function)%%%*/ if (aout != NULL) { *aout = mid; } @@ -683,7 +674,6 @@ GetAOutFileInfo(fd, load, xfr, a_text, a_text_fill, #endif NOAOUT } -/*###673 [cc] syntax error before `int'%%%*/ int GetFileInfo(fd, load, xfr, aout, a_text, a_text_fill, a_data, a_data_fill, a_bss, a_bss_fill) @@ -722,7 +712,6 @@ GetFileInfo(fd, load, xfr, aout, } ssize_t -/*###711 [cc] syntax error before `mopFileRead'%%%*/ mopFileRead(dlslot, buf) struct dllist *dlslot; u_char *buf; @@ -731,9 +720,7 @@ mopFileRead(dlslot, buf) int bsz; long pos, notdone, total; -/*###719 [cc] `dlslot' undeclared (first use this function)%%%*/ if (dlslot->aout == -1) { -/*###720 [cc] `buf' undeclared (first use this function)%%%*/ len = read(dlslot->ldfd,buf,dlslot->dl_bsz); } else { bsz = dlslot->dl_bsz; @@ -745,10 +732,8 @@ mopFileRead(dlslot, buf) if (pos < total) { notdone = total - pos; if (notdone <= bsz) { -/*###731 [cc] subscripted value is neither array nor pointer%%%*/ outlen = read(dlslot->ldfd,&buf[len],notdone); } else { -/*###733 [cc] subscripted value is neither array nor pointer%%%*/ outlen = read(dlslot->ldfd,&buf[len],bsz); } len = len + outlen; @@ -765,7 +750,6 @@ mopFileRead(dlslot, buf) } else { outlen = bsz; } -/*###749 [cc] subscripted value is neither array nor pointer%%%*/ bzero(&buf[len],outlen); len = len + outlen; pos = pos + outlen; @@ -777,10 +761,8 @@ mopFileRead(dlslot, buf) if ((bsz > 0) && (pos < total)) { notdone = total - pos; if (notdone <= bsz) { -/*###760 [cc] subscripted value is neither array nor pointer%%%*/ outlen = read(dlslot->ldfd,&buf[len],notdone); } else { -/*###762 [cc] subscripted value is neither array nor pointer%%%*/ outlen = read(dlslot->ldfd,&buf[len],bsz); } len = len + outlen; @@ -797,7 +779,6 @@ mopFileRead(dlslot, buf) } else { outlen = bsz; } -/*###778 [cc] subscripted value is neither array nor pointer%%%*/ bzero(&buf[len],outlen); len = len + outlen; pos = pos + outlen; @@ -813,7 +794,6 @@ mopFileRead(dlslot, buf) } else { outlen = bsz; } -/*###793 [cc] subscripted value is neither array nor pointer%%%*/ bzero(&buf[len],outlen); len = len + outlen; pos = pos + outlen; @@ -829,7 +809,6 @@ mopFileRead(dlslot, buf) } else { outlen = bsz; } -/*###808 [cc] subscripted value is neither array nor pointer%%%*/ bzero(&buf[len],outlen); len = len + outlen; pos = pos + outlen; @@ -842,4 +821,3 @@ mopFileRead(dlslot, buf) return(len); } -/*###820 [cc] syntax error at end of input%%%*/ |