mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
libc, libthread, ape: mark exit functions as _Noreturn and clean up new warnings
This commit is contained in:
parent
6b0574e27e
commit
8a234e57b9
120 changed files with 88 additions and 244 deletions
|
@ -98,7 +98,6 @@ command(Window *w, char *s)
|
||||||
if(strcmp(s, "Delete")==0 || strcmp(s, "Del")==0){
|
if(strcmp(s, "Delete")==0 || strcmp(s, "Del")==0){
|
||||||
windel(w, 1);
|
windel(w, 1);
|
||||||
threadexitsall(nil);
|
threadexitsall(nil);
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
if(EQUAL(s, "scroll")){
|
if(EQUAL(s, "scroll")){
|
||||||
ctlprint(w->ctl, "scroll\nshow");
|
ctlprint(w->ctl, "scroll\nshow");
|
||||||
|
|
|
@ -52,7 +52,6 @@ pipecommand(Window *w, char *s)
|
||||||
if(strcmp(s, "Delete")==0){
|
if(strcmp(s, "Delete")==0){
|
||||||
windel(w, 1);
|
windel(w, 1);
|
||||||
threadexits(nil);
|
threadexits(nil);
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
if(strcmp(s, "Del")==0){
|
if(strcmp(s, "Del")==0){
|
||||||
if(windel(w, 0))
|
if(windel(w, 0))
|
||||||
|
|
|
@ -31,9 +31,9 @@ extern void *calloc(size_t, size_t);
|
||||||
extern void free(void *);
|
extern void free(void *);
|
||||||
extern void *malloc(size_t);
|
extern void *malloc(size_t);
|
||||||
extern void *realloc(void *, size_t);
|
extern void *realloc(void *, size_t);
|
||||||
extern void abort(void);
|
extern _Noreturn void abort(void);
|
||||||
extern int atexit(void (*func)(void));
|
extern int atexit(void (*func)(void));
|
||||||
extern void exit(int);
|
extern _Noreturn void exit(int);
|
||||||
extern char *getenv(const char *);
|
extern char *getenv(const char *);
|
||||||
extern int putenv(char *);
|
extern int putenv(char *);
|
||||||
extern int system(const char *);
|
extern int system(const char *);
|
||||||
|
|
|
@ -90,7 +90,7 @@ extern int execle(const char *, const char *, const char *, ...);
|
||||||
extern int execve(const char *, const char **, const char **);
|
extern int execve(const char *, const char **, const char **);
|
||||||
extern int execlp(const char *, const char *, ...);
|
extern int execlp(const char *, const char *, ...);
|
||||||
extern int execvp(const char *, const char **);
|
extern int execvp(const char *, const char **);
|
||||||
extern void _exit(int);
|
extern _Noreturn void _exit(int);
|
||||||
extern unsigned int alarm(unsigned int);
|
extern unsigned int alarm(unsigned int);
|
||||||
extern int pause(void);
|
extern int pause(void);
|
||||||
extern unsigned int sleep(unsigned int);
|
extern unsigned int sleep(unsigned int);
|
||||||
|
|
|
@ -416,7 +416,7 @@ extern int dec16chr(int);
|
||||||
extern int enc16chr(int);
|
extern int enc16chr(int);
|
||||||
|
|
||||||
extern int encodefmt(Fmt*);
|
extern int encodefmt(Fmt*);
|
||||||
extern void exits(char*);
|
extern _Noreturn void exits(char*);
|
||||||
extern double frexp(double, int*);
|
extern double frexp(double, int*);
|
||||||
extern uintptr getcallerpc(void*);
|
extern uintptr getcallerpc(void*);
|
||||||
extern char* getenv(char*);
|
extern char* getenv(char*);
|
||||||
|
@ -427,7 +427,7 @@ extern char* getwd(char*, int);
|
||||||
extern int iounit(int);
|
extern int iounit(int);
|
||||||
extern long labs(long);
|
extern long labs(long);
|
||||||
extern double ldexp(double, int);
|
extern double ldexp(double, int);
|
||||||
extern void longjmp(jmp_buf, int);
|
extern _Noreturn void longjmp(jmp_buf, int);
|
||||||
extern char* mktemp(char*);
|
extern char* mktemp(char*);
|
||||||
extern double modf(double, double*);
|
extern double modf(double, double*);
|
||||||
extern int netcrypt(void*, void*);
|
extern int netcrypt(void*, void*);
|
||||||
|
@ -443,7 +443,7 @@ extern long strtol(char*, char**, int);
|
||||||
extern ulong strtoul(char*, char**, int);
|
extern ulong strtoul(char*, char**, int);
|
||||||
extern vlong strtoll(char*, char**, int);
|
extern vlong strtoll(char*, char**, int);
|
||||||
extern uvlong strtoull(char*, char**, int);
|
extern uvlong strtoull(char*, char**, int);
|
||||||
extern void sysfatal(char*, ...);
|
extern _Noreturn void sysfatal(char*, ...);
|
||||||
#pragma varargck argpos sysfatal 1
|
#pragma varargck argpos sysfatal 1
|
||||||
extern void syslog(int, char*, char*, ...);
|
extern void syslog(int, char*, char*, ...);
|
||||||
#pragma varargck argpos syslog 3
|
#pragma varargck argpos syslog 3
|
||||||
|
@ -690,9 +690,9 @@ struct IOchunk
|
||||||
ulong len;
|
ulong len;
|
||||||
} IOchunk;
|
} IOchunk;
|
||||||
|
|
||||||
extern void _exits(char*);
|
extern _Noreturn void _exits(char*);
|
||||||
|
|
||||||
extern void abort(void);
|
extern _Noreturn void abort(void);
|
||||||
extern int access(char*, int);
|
extern int access(char*, int);
|
||||||
extern long alarm(ulong);
|
extern long alarm(ulong);
|
||||||
extern int await(char*, int);
|
extern int await(char*, int);
|
||||||
|
|
|
@ -87,8 +87,8 @@ int sendp(Channel *c, void *v);
|
||||||
int sendul(Channel *c, ulong v);
|
int sendul(Channel *c, ulong v);
|
||||||
int threadcreate(void (*f)(void *arg), void *arg, uint stacksize);
|
int threadcreate(void (*f)(void *arg), void *arg, uint stacksize);
|
||||||
void** threaddata(void);
|
void** threaddata(void);
|
||||||
void threadexits(char *);
|
_Noreturn void threadexits(char *);
|
||||||
void threadexitsall(char *);
|
_Noreturn void threadexitsall(char *);
|
||||||
int threadgetgrp(void); /* return thread group of current thread */
|
int threadgetgrp(void); /* return thread group of current thread */
|
||||||
char* threadgetname(void);
|
char* threadgetname(void);
|
||||||
void threadint(int); /* interrupt thread */
|
void threadint(int); /* interrupt thread */
|
||||||
|
|
|
@ -123,5 +123,4 @@ main(int argc, char **argv)
|
||||||
else
|
else
|
||||||
exits(w->msg);
|
exits(w->msg);
|
||||||
}
|
}
|
||||||
assert(0);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,7 @@ extern vlong _NSEC(void);
|
||||||
|
|
||||||
int errstr(char*, unsigned int);
|
int errstr(char*, unsigned int);
|
||||||
void rerrstr(char*, unsigned int);
|
void rerrstr(char*, unsigned int);
|
||||||
extern void sysfatal(char*, ...);
|
extern _Noreturn void sysfatal(char*, ...);
|
||||||
|
|
||||||
extern void setmalloctag(void*, uintptr_t);
|
extern void setmalloctag(void*, uintptr_t);
|
||||||
extern void setrealloctag(void*, uintptr_t);
|
extern void setrealloctag(void*, uintptr_t);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
void
|
_Noreturn void
|
||||||
abort(void)
|
abort(void)
|
||||||
{
|
{
|
||||||
kill(getpid(), SIGABRT);
|
kill(getpid(), SIGABRT);
|
||||||
|
|
|
@ -10,7 +10,7 @@ int _sessleader = 0;
|
||||||
|
|
||||||
static char exitstatus[ERRMAX];
|
static char exitstatus[ERRMAX];
|
||||||
|
|
||||||
void
|
_Noreturn void
|
||||||
_exit(int status)
|
_exit(int status)
|
||||||
{
|
{
|
||||||
_finish(status, 0);
|
_finish(status, 0);
|
||||||
|
|
|
@ -100,7 +100,6 @@ fpaoperation(u32int instr)
|
||||||
case 19: res = (vlong) op2; break;
|
case 19: res = (vlong) op2; break;
|
||||||
case 20: res = sqrt(op2); break;
|
case 20: res = sqrt(op2); break;
|
||||||
default: sysfatal("unimplemented FPA operation %#x @ %8ux", opc, P->R[15] - 4);
|
default: sysfatal("unimplemented FPA operation %#x @ %8ux", opc, P->R[15] - 4);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
switch(prec) {
|
switch(prec) {
|
||||||
case 0: *Fd = (float) res; break;
|
case 0: *Fd = (float) res; break;
|
||||||
|
|
|
@ -281,5 +281,4 @@ vaddr(ulong addr)
|
||||||
}
|
}
|
||||||
Bprint(bioout, "User TLB miss vaddr 0x%.8lux\n", addr);
|
Bprint(bioout, "User TLB miss vaddr 0x%.8lux\n", addr);
|
||||||
longjmp(errjmp, 0);
|
longjmp(errjmp, 0);
|
||||||
return 0; /*to stop compiler whining*/
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -286,7 +286,6 @@ shutdown(void*, char *msg)
|
||||||
threadexitsall(msg);
|
threadexitsall(msg);
|
||||||
print("acme: %s\n", msg);
|
print("acme: %s\n", msg);
|
||||||
abort();
|
abort();
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -1206,5 +1206,4 @@ armalloc(int n)
|
||||||
} while (getspace());
|
} while (getspace());
|
||||||
fprint(2, "ar: out of memory\n");
|
fprint(2, "ar: out of memory\n");
|
||||||
exits("malloc");
|
exits("malloc");
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,7 +169,6 @@ value(int c, int f)
|
||||||
return(-1);
|
return(-1);
|
||||||
fprint(2, "%s: bad input char %c\n", argv0, c);
|
fprint(2, "%s: bad input char %c\n", argv0, c);
|
||||||
exits("bad");
|
exits("bad");
|
||||||
return 0; /* to keep ken happy */
|
|
||||||
}
|
}
|
||||||
int
|
int
|
||||||
isnum(char *s)
|
isnum(char *s)
|
||||||
|
|
|
@ -569,7 +569,6 @@ mkdesc(char *f)
|
||||||
return d;
|
return d;
|
||||||
Bad:
|
Bad:
|
||||||
sysfatal("bad format: %s", f);
|
sysfatal("bad format: %s", f);
|
||||||
return d;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -608,8 +607,8 @@ main(int argc, char *argv[])
|
||||||
int k, n, m, nin, nout;
|
int k, n, m, nin, nout;
|
||||||
vlong l;
|
vlong l;
|
||||||
|
|
||||||
void (*oconv)(int *, uchar *, int, int, int) = nil;
|
void (*oconv)(int *, uchar *, int, int, int);
|
||||||
void (*iconv)(int *, uchar *, int, int, int) = nil;
|
void (*iconv)(int *, uchar *, int, int, int);
|
||||||
|
|
||||||
o = mkdesc("s16c2r44100");
|
o = mkdesc("s16c2r44100");
|
||||||
i = o;
|
i = o;
|
||||||
|
|
|
@ -37,7 +37,6 @@ tag(Tagctx *ctx, int t, const char *k, const char *v, int offset, int size, Tagr
|
||||||
if(image){
|
if(image){
|
||||||
if(t != Timage)
|
if(t != Timage)
|
||||||
return;
|
return;
|
||||||
prog = nil;
|
|
||||||
if(strcmp(v, "image/jpeg") == 0)
|
if(strcmp(v, "image/jpeg") == 0)
|
||||||
prog = "jpg";
|
prog = "jpg";
|
||||||
else if(strcmp(v, "image/png") == 0)
|
else if(strcmp(v, "image/png") == 0)
|
||||||
|
|
|
@ -53,7 +53,6 @@ main(void)
|
||||||
dup(pfd[0], 0);
|
dup(pfd[0], 0);
|
||||||
execl("/bin/audio/pcmconv", "pcmconv", "-i", fmt, nil);
|
execl("/bin/audio/pcmconv", "pcmconv", "-i", fmt, nil);
|
||||||
sysfatal("exec: %r");
|
sysfatal("exec: %r");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
close(pfd[0]);
|
close(pfd[0]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -235,7 +235,6 @@ getcol(Meta *m, int c)
|
||||||
static char tmp[32];
|
static char tmp[32];
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
s = nil;
|
|
||||||
switch(c){
|
switch(c){
|
||||||
case Palbum: s = m->album; break;
|
case Palbum: s = m->album; break;
|
||||||
case Partist: s = m->artist[0]; break;
|
case Partist: s = m->artist[0]; break;
|
||||||
|
|
|
@ -271,10 +271,8 @@ endpoints(void)
|
||||||
jsonfree(j);
|
jsonfree(j);
|
||||||
free(s);
|
free(s);
|
||||||
if(epnewnonce==nil|| epnewacct==nil || epneworder==nil
|
if(epnewnonce==nil|| epnewacct==nil || epneworder==nil
|
||||||
|| eprevokecert==nil || epkeychange==nil){
|
|| eprevokecert==nil || epkeychange==nil)
|
||||||
sysfatal("missing directory entries");
|
sysfatal("missing directory entries");
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -343,10 +343,8 @@ mkasn1(uchar *asn1, char *alg, uchar *d, uint dlen)
|
||||||
}else if(strcmp(alg, "sha256") == 0){
|
}else if(strcmp(alg, "sha256") == 0){
|
||||||
obj = oidsha256;
|
obj = oidsha256;
|
||||||
olen = sizeof(oidsha256);
|
olen = sizeof(oidsha256);
|
||||||
}else{
|
}else
|
||||||
sysfatal("bad alg in mkasn1");
|
sysfatal("bad alg in mkasn1");
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
p = asn1;
|
p = asn1;
|
||||||
*p++ = 0x30; /* sequence */
|
*p++ = 0x30; /* sequence */
|
||||||
|
|
|
@ -36,7 +36,6 @@ main(int argc, char **argv)
|
||||||
if(argc > 1)
|
if(argc > 1)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
n = -1;
|
|
||||||
if((k = getrsakey(argc, argv, privatekey, nil)) == nil)
|
if((k = getrsakey(argc, argv, privatekey, nil)) == nil)
|
||||||
sysfatal("%r");
|
sysfatal("%r");
|
||||||
if(privatekey){
|
if(privatekey){
|
||||||
|
|
|
@ -149,5 +149,4 @@ main(int argc, char **argv)
|
||||||
if(Bflush(&bout) != 0)
|
if(Bflush(&bout) != 0)
|
||||||
sysfatal("write: %r");
|
sysfatal("write: %r");
|
||||||
exits(nil);
|
exits(nil);
|
||||||
return 1; /* keep other compilers happy */
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -268,8 +268,6 @@ mail(Fs *f, char *rcvr, char *user, long et)
|
||||||
|
|
||||||
/* just in case */
|
/* just in case */
|
||||||
sysfatal("can't exec send: %r");
|
sysfatal("can't exec send: %r");
|
||||||
|
|
||||||
return 0; /* for compiler */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -127,7 +127,6 @@ main(int argc, char **argv)
|
||||||
relocs = 1;
|
relocs = 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SET(arch, chars);
|
|
||||||
sysfatal("archloch");
|
sysfatal("archloch");
|
||||||
}
|
}
|
||||||
szofdat = fhdr.txtsz + fhdr.datsz;
|
szofdat = fhdr.txtsz + fhdr.datsz;
|
||||||
|
|
|
@ -35,7 +35,6 @@ putc3(uchar *buff, ulong v)
|
||||||
|
|
||||||
fprint(2, "%s: putc3 fail 0x%lux, called from %#p\n", prog, v, getcallerpc(&buff));
|
fprint(2, "%s: putc3 fail 0x%lux, called from %#p\n", prog, v, getcallerpc(&buff));
|
||||||
abort();
|
abort();
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -555,7 +555,6 @@ otherlen(int a)
|
||||||
else if(a == 4)
|
else if(a == 4)
|
||||||
return 2;
|
return 2;
|
||||||
abort();
|
abort();
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -126,7 +126,6 @@ bar(Biobuf *b)
|
||||||
sleep(1000);
|
sleep(1000);
|
||||||
while(!die && (k = eread(Ekeyboard|Emouse, &e))) {
|
while(!die && (k = eread(Ekeyboard|Emouse, &e))) {
|
||||||
if(nokill==0 && k == Ekeyboard && (e.kbdc == Kdel || e.kbdc == Ketx)) {
|
if(nokill==0 && k == Ekeyboard && (e.kbdc == Kdel || e.kbdc == Ketx)) {
|
||||||
die = 1;
|
|
||||||
postnote(PNPROC, parent, "interrupt");
|
postnote(PNPROC, parent, "interrupt");
|
||||||
_exits("interrupt");
|
_exits("interrupt");
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,6 @@ msg(Biobuf *b)
|
||||||
sleep(1000);
|
sleep(1000);
|
||||||
while(!die && (k = eread(Ekeyboard|Emouse, &e))) {
|
while(!die && (k = eread(Ekeyboard|Emouse, &e))) {
|
||||||
if(nokill==0 && k == Ekeyboard && (e.kbdc == Kdel || e.kbdc == Ketx)) {
|
if(nokill==0 && k == Ekeyboard && (e.kbdc == Kdel || e.kbdc == Ketx)) {
|
||||||
die = 1;
|
|
||||||
postnote(PNPROC, parent, "interrupt");
|
postnote(PNPROC, parent, "interrupt");
|
||||||
_exits("interrupt");
|
_exits("interrupt");
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,10 +241,8 @@ buildrsne(uchar rsne[258])
|
||||||
return 0; /* not an error, might be old kernel */
|
return 0; /* not an error, might be old kernel */
|
||||||
|
|
||||||
brsnelen = hextob(buf, nil, brsne, sizeof(brsne));
|
brsnelen = hextob(buf, nil, brsne, sizeof(brsne));
|
||||||
if(brsnelen <= 4){
|
if(brsnelen <= 4)
|
||||||
trunc: sysfatal("invalid or truncated RSNE; brsne: %s", buf);
|
trunc: sysfatal("invalid or truncated RSNE; brsne: %s", buf);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
w = rsne;
|
w = rsne;
|
||||||
p = brsne;
|
p = brsne;
|
||||||
|
@ -257,10 +255,8 @@ trunc: sysfatal("invalid or truncated RSNE; brsne: %s", buf);
|
||||||
*w++ = 0; /* length */
|
*w++ = 0; /* length */
|
||||||
} else if(p[0] == 0xDD){
|
} else if(p[0] == 0xDD){
|
||||||
p += 2;
|
p += 2;
|
||||||
if((e - p) < 4 || memcmp(p, wpa1oui, 4) != 0){
|
if((e - p) < 4 || memcmp(p, wpa1oui, 4) != 0)
|
||||||
sysfatal("unrecognized WPAIE type; brsne: %s", buf);
|
sysfatal("unrecognized WPAIE type; brsne: %s", buf);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* WPA */
|
/* WPA */
|
||||||
*w++ = 0xDD;
|
*w++ = 0xDD;
|
||||||
|
@ -269,10 +265,8 @@ trunc: sysfatal("invalid or truncated RSNE; brsne: %s", buf);
|
||||||
memmove(w, wpa1oui, 4);
|
memmove(w, wpa1oui, 4);
|
||||||
w += 4;
|
w += 4;
|
||||||
p += 4;
|
p += 4;
|
||||||
} else {
|
} else
|
||||||
sysfatal("unrecognized RSNE type; brsne: %s", buf);
|
sysfatal("unrecognized RSNE type; brsne: %s", buf);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if((e - p) < 6)
|
if((e - p) < 6)
|
||||||
goto trunc;
|
goto trunc;
|
||||||
|
@ -285,15 +279,11 @@ trunc: sysfatal("invalid or truncated RSNE; brsne: %s", buf);
|
||||||
groupcipher = &ccmp;
|
groupcipher = &ccmp;
|
||||||
else if(memcmp(p, rsntkipoui, 4) == 0)
|
else if(memcmp(p, rsntkipoui, 4) == 0)
|
||||||
groupcipher = &tkip;
|
groupcipher = &tkip;
|
||||||
else {
|
else
|
||||||
sysfatal("unrecognized RSN group cipher; brsne: %s", buf);
|
sysfatal("unrecognized RSN group cipher; brsne: %s", buf);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if(memcmp(p, wpatkipoui, 4) != 0){
|
if(memcmp(p, wpatkipoui, 4) != 0)
|
||||||
sysfatal("unrecognized WPA group cipher; brsne: %s", buf);
|
sysfatal("unrecognized WPA group cipher; brsne: %s", buf);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
groupcipher = &tkip;
|
groupcipher = &tkip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,10 +355,8 @@ trunc: sysfatal("invalid or truncated RSNE; brsne: %s", buf);
|
||||||
}
|
}
|
||||||
p += 4;
|
p += 4;
|
||||||
}
|
}
|
||||||
if(i >= n){
|
if(i >= n)
|
||||||
sysfatal("auth suite is not PSK or WPA; brsne: %s", buf);
|
sysfatal("auth suite is not PSK or WPA; brsne: %s", buf);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
memmove(w, p, 4);
|
memmove(w, p, 4);
|
||||||
w += 4;
|
w += 4;
|
||||||
|
@ -1146,7 +1134,6 @@ background(void)
|
||||||
exits(nil);
|
exits(nil);
|
||||||
case -1:
|
case -1:
|
||||||
sysfatal("fork: %r");
|
sysfatal("fork: %r");
|
||||||
return;
|
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,6 @@ blockread(int in, char *first, int nfirst)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
_exits(0);
|
_exits(0);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -104,5 +104,4 @@ unbflz(int in)
|
||||||
close(in);
|
close(in);
|
||||||
close(out);
|
close(out);
|
||||||
_exits(0);
|
_exits(0);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,7 +165,6 @@ unbzip(int in)
|
||||||
|
|
||||||
_unbzip(in, out);
|
_unbzip(in, out);
|
||||||
_exits(0);
|
_exits(0);
|
||||||
return -1; /* not reached */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int bz_config_ok ( void )
|
int bz_config_ok ( void )
|
||||||
|
|
|
@ -16,7 +16,6 @@ main(int argc, char *argv[])
|
||||||
usage:
|
usage:
|
||||||
fprint(2, "usage: chgrp [ -uo ] group file ....\n");
|
fprint(2, "usage: chgrp [ -uo ] group file ....\n");
|
||||||
exits("usage");
|
exits("usage");
|
||||||
return;
|
|
||||||
case 'u':
|
case 'u':
|
||||||
case 'o':
|
case 'o':
|
||||||
uflag++;
|
uflag++;
|
||||||
|
|
|
@ -173,5 +173,4 @@ openfil(char *s)
|
||||||
return b;
|
return b;
|
||||||
fprint(2,"comm: cannot open %s: %r\n",s);
|
fprint(2,"comm: cannot open %s: %r\n",s);
|
||||||
exits("open");
|
exits("open");
|
||||||
return 0; /* shut up ken */
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,6 @@ main(int argc, char **argv)
|
||||||
flushout();
|
flushout();
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
exits(nerrs? "errors" : 0);
|
exits(nerrs? "errors" : 0);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -1453,7 +1453,6 @@ loop:
|
||||||
goto loop;
|
goto loop;
|
||||||
}
|
}
|
||||||
exits(0);
|
exits(0);
|
||||||
return 0; /* shut up ken */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -114,10 +114,8 @@ prepare(Diff *d, int i, char *arg, char *orig)
|
||||||
} else
|
} else
|
||||||
d->file2 = orig;
|
d->file2 = orig;
|
||||||
bp = Bopen(arg, OREAD);
|
bp = Bopen(arg, OREAD);
|
||||||
if (!bp) {
|
if (!bp)
|
||||||
sysfatal("cannot open %s: %r", arg);
|
sysfatal("cannot open %s: %r", arg);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (d->binary)
|
if (d->binary)
|
||||||
return bp;
|
return bp;
|
||||||
nbytes = Bread(bp, buf, MIN(1024, MAXLINELEN));
|
nbytes = Bread(bp, buf, MIN(1024, MAXLINELEN));
|
||||||
|
|
|
@ -36,10 +36,8 @@ erealloc(void *p, unsigned n)
|
||||||
int
|
int
|
||||||
mkpathname(char *pathname, char *path, char *name)
|
mkpathname(char *pathname, char *path, char *name)
|
||||||
{
|
{
|
||||||
if (strlen(path) + strlen(name) > MAXPATHLEN) {
|
if (strlen(path) + strlen(name) > MAXPATHLEN)
|
||||||
sysfatal("pathname %s/%s too long", path, name);
|
sysfatal("pathname %s/%s too long", path, name);
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
sprint(pathname, "%s/%s", path, name);
|
sprint(pathname, "%s/%s", path, name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -59,19 +57,15 @@ mktmpfile(int input, Dir **sb)
|
||||||
* the system will remove the file for us.
|
* the system will remove the file for us.
|
||||||
*/
|
*/
|
||||||
fd = create(p, OWRITE|ORCLOSE, 0600);
|
fd = create(p, OWRITE|ORCLOSE, 0600);
|
||||||
if (fd < 0) {
|
if (fd < 0)
|
||||||
sysfatal("cannot create %s: %r", p);
|
sysfatal("cannot create %s: %r", p);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
while ((i = read(input, buf, sizeof(buf))) > 0) {
|
while ((i = read(input, buf, sizeof(buf))) > 0) {
|
||||||
if ((i = write(fd, buf, i)) < 0)
|
if ((i = write(fd, buf, i)) < 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*sb = dirfstat(fd);
|
*sb = dirfstat(fd);
|
||||||
if (i < 0) {
|
if (i < 0)
|
||||||
sysfatal("cannot read/write %s: %r", p);
|
sysfatal("cannot read/write %s: %r", p);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,18 +77,14 @@ statfile(char *file, Dir **sb)
|
||||||
|
|
||||||
dir = dirstat(file);
|
dir = dirstat(file);
|
||||||
if(dir == nil) {
|
if(dir == nil) {
|
||||||
if (strcmp(file, "-") || (dir = dirfstat(0)) == nil) {
|
if (strcmp(file, "-") || (dir = dirfstat(0)) == nil)
|
||||||
sysfatal("cannot stat %s: %r", file);
|
sysfatal("cannot stat %s: %r", file);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
free(dir);
|
free(dir);
|
||||||
return mktmpfile(0, sb);
|
return mktmpfile(0, sb);
|
||||||
} else if (!REGULAR_FILE(dir) && !DIRECTORY(dir)) {
|
} else if (!REGULAR_FILE(dir) && !DIRECTORY(dir)) {
|
||||||
free(dir);
|
free(dir);
|
||||||
if ((input = open(file, OREAD)) == -1) {
|
if ((input = open(file, OREAD)) == -1)
|
||||||
sysfatal("cannot open %s: %r", file);
|
sysfatal("cannot open %s: %r", file);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
file = mktmpfile(input, sb);
|
file = mktmpfile(input, sb);
|
||||||
close(input);
|
close(input);
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -101,10 +101,8 @@ adddirec(Direc *root, char *name, XDir *d)
|
||||||
if((p = strrchr(name, '/')) != nil) {
|
if((p = strrchr(name, '/')) != nil) {
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
root = walkdirec(root, name);
|
root = walkdirec(root, name);
|
||||||
if(root == nil) {
|
if(root == nil)
|
||||||
sysfatal("error in proto file: no entry for /%s but /%s/%s", name, name, p+1);
|
sysfatal("error in proto file: no entry for /%s but /%s/%s", name, name, p+1);
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
*p = '/';
|
*p = '/';
|
||||||
p++;
|
p++;
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -368,10 +368,8 @@ getblock(Disk *disk, vlong addr)
|
||||||
return b->data;
|
return b->data;
|
||||||
}
|
}
|
||||||
b = malloc(sizeof(Block) + 2*disk->secsize);
|
b = malloc(sizeof(Block) + 2*disk->secsize);
|
||||||
if(pread(disk->fd, b->data, disk->secsize, disk->secsize*addr) != disk->secsize){
|
if(pread(disk->fd, b->data, disk->secsize, disk->secsize*addr) != disk->secsize)
|
||||||
sysfatal("getblock %llud: %r", addr);
|
sysfatal("getblock %llud: %r", addr);
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
b->save = &b->data[disk->secsize];
|
b->save = &b->data[disk->secsize];
|
||||||
memmove(b->save, b->data, disk->secsize);
|
memmove(b->save, b->data, disk->secsize);
|
||||||
|
|
||||||
|
|
|
@ -293,7 +293,6 @@ editquit(Edit *edit, int argc, char**)
|
||||||
}
|
}
|
||||||
|
|
||||||
exits(0);
|
exits(0);
|
||||||
return nil; /* not reached */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char*
|
char*
|
||||||
|
|
|
@ -60,7 +60,7 @@ Edit edit = {
|
||||||
* Catch the obvious error routines to fix up the disk.
|
* Catch the obvious error routines to fix up the disk.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
sysfatal(char *fmt, ...)
|
diskfatal(char *fmt, ...)
|
||||||
{
|
{
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
va_list arg;
|
va_list arg;
|
||||||
|
@ -79,11 +79,25 @@ sysfatal(char *fmt, ...)
|
||||||
exits(buf);
|
exits(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void*
|
||||||
abort(void)
|
errmalloc(ulong sz)
|
||||||
{
|
{
|
||||||
fprint(2, "abort\n");
|
void *v;
|
||||||
recover(&edit);
|
|
||||||
|
v = malloc(sz);
|
||||||
|
if(v == nil)
|
||||||
|
diskfatal("malloc %lud fails", sz);
|
||||||
|
memset(v, 0, sz);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
char*
|
||||||
|
errstrdup(char *s)
|
||||||
|
{
|
||||||
|
s = strdup(s);
|
||||||
|
if(s == nil)
|
||||||
|
diskfatal("strdup (%.10s) fails", s);
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -375,9 +389,9 @@ static void
|
||||||
diskread(Disk *disk, void *data, int ndata, u32int sec, u32int off)
|
diskread(Disk *disk, void *data, int ndata, u32int sec, u32int off)
|
||||||
{
|
{
|
||||||
if(seek(disk->fd, (vlong)sec*disk->secsize+off, 0) != (vlong)sec*disk->secsize+off)
|
if(seek(disk->fd, (vlong)sec*disk->secsize+off, 0) != (vlong)sec*disk->secsize+off)
|
||||||
sysfatal("diskread seek %lud.%lud: %r", (ulong)sec, (ulong)off);
|
diskfatal("diskread seek %lud.%lud: %r", (ulong)sec, (ulong)off);
|
||||||
if(readn(disk->fd, data, ndata) != ndata)
|
if(readn(disk->fd, data, ndata) != ndata)
|
||||||
sysfatal("diskread %lud at %lud.%lud: %r", (ulong)ndata, (ulong)sec, (ulong)off);
|
diskfatal("diskread %lud at %lud.%lud: %r", (ulong)ndata, (ulong)sec, (ulong)off);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -403,11 +417,11 @@ mkpart(char *name, vlong lba, vlong size, Tentry *t, vlong ebrstart, int ebrtype
|
||||||
Dospart *p;
|
Dospart *p;
|
||||||
|
|
||||||
primary = (ebrstart == 0) && (ebrtype == 0);
|
primary = (ebrstart == 0) && (ebrtype == 0);
|
||||||
p = emalloc(sizeof(*p));
|
p = errmalloc(sizeof(*p));
|
||||||
if(name)
|
if(name)
|
||||||
p->name = estrdup(name);
|
p->name = errstrdup(name);
|
||||||
else{
|
else{
|
||||||
p->name = emalloc(20);
|
p->name = errmalloc(20);
|
||||||
sprint(p->name, "%c%d", primary ? 'p' : 's', ++n);
|
sprint(p->name, "%c%d", primary ? 'p' : 's', ++n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,7 +466,7 @@ addrecover(Table t, ulong lba)
|
||||||
if((nrtab%8) == 0) {
|
if((nrtab%8) == 0) {
|
||||||
rtab = realloc(rtab, (nrtab+8)*sizeof(rtab[0]));
|
rtab = realloc(rtab, (nrtab+8)*sizeof(rtab[0]));
|
||||||
if(rtab == nil)
|
if(rtab == nil)
|
||||||
sysfatal("out of memory");
|
diskfatal("out of memory");
|
||||||
}
|
}
|
||||||
rtab[nrtab] = (Recover){t, lba};
|
rtab[nrtab] = (Recover){t, lba};
|
||||||
nrtab++;
|
nrtab++;
|
||||||
|
@ -550,7 +564,7 @@ findmbr(Edit *edit)
|
||||||
|
|
||||||
diskread(edit->disk, &table, Tablesize, 0, Toffset);
|
diskread(edit->disk, &table, Tablesize, 0, Toffset);
|
||||||
if(table.magic[0] != Magic0 || table.magic[1] != Magic1)
|
if(table.magic[0] != Magic0 || table.magic[1] != Magic1)
|
||||||
sysfatal("did not find master boot record");
|
diskfatal("did not find master boot record");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -693,7 +707,7 @@ plan9print(Dospart *part, int fd)
|
||||||
sep = "";
|
sep = "";
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
name = emalloc(strlen(vname)+10);
|
name = errmalloc(strlen(vname)+10);
|
||||||
|
|
||||||
sprint(name, "%s", vname);
|
sprint(name, "%s", vname);
|
||||||
do {
|
do {
|
||||||
|
@ -707,7 +721,7 @@ plan9print(Dospart *part, int fd)
|
||||||
}
|
}
|
||||||
} while(ok == 0);
|
} while(ok == 0);
|
||||||
|
|
||||||
n = emalloc(sizeof(*n));
|
n = errmalloc(sizeof(*n));
|
||||||
n->name = name;
|
n->name = name;
|
||||||
n->link = namelist;
|
n->link = namelist;
|
||||||
namelist = n;
|
namelist = n;
|
||||||
|
@ -1130,7 +1144,7 @@ wrpart(Edit *edit)
|
||||||
memset(tp, 0, sizeof(*tp));
|
memset(tp, 0, sizeof(*tp));
|
||||||
|
|
||||||
if(i != edit->npart)
|
if(i != edit->npart)
|
||||||
sysfatal("cannot happen #1");
|
diskfatal("cannot happen #1");
|
||||||
|
|
||||||
if(diskwrite(disk, &table, Tablesize, 0, Toffset) < 0)
|
if(diskwrite(disk, &table, Tablesize, 0, Toffset) < 0)
|
||||||
recover(edit);
|
recover(edit);
|
||||||
|
|
|
@ -378,10 +378,10 @@ receval(Node *n, uchar *p, uchar *e, Enab *en)
|
||||||
return mkval(VALINT, v);
|
return mkval(VALINT, v);
|
||||||
case DTV_PROBE:
|
case DTV_PROBE:
|
||||||
return mkval(VALSTR, en->probe);
|
return mkval(VALSTR, en->probe);
|
||||||
default: sysfatal("receval: unknown variable %d", n->type); return mkval(VALINT, 0LL);
|
default: sysfatal("receval: unknown variable %d", n->type);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: sysfatal("receval: unknown symbol type %d", n->type); return mkval(VALINT, 0LL);
|
default: sysfatal("receval: unknown symbol type %d", n->type);
|
||||||
}
|
}
|
||||||
case ONUM: return mkval(VALINT, n->num);
|
case ONUM: return mkval(VALINT, n->num);
|
||||||
case OBIN:
|
case OBIN:
|
||||||
|
@ -420,7 +420,6 @@ receval(Node *n, uchar *p, uchar *e, Enab *en)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
sysfatal("receval: unknown type %α", n->type);
|
sysfatal("receval: unknown type %α", n->type);
|
||||||
return mkval(VALINT, 0LL);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,7 @@ egen(Node *n)
|
||||||
rt = regalloc();
|
rt = regalloc();
|
||||||
emit(DTE(DTE_LDV, n->sym->idx, rt, 0));
|
emit(DTE(DTE_LDV, n->sym->idx, rt, 0));
|
||||||
return rt;
|
return rt;
|
||||||
default: sysfatal("egen: unknown symbol type %d", n->sym->type); return 0;
|
default: sysfatal("egen: unknown symbol type %d", n->sym->type);
|
||||||
}
|
}
|
||||||
case OBIN:
|
case OBIN:
|
||||||
switch(/*oper*/n->op){
|
switch(/*oper*/n->op){
|
||||||
|
@ -204,7 +204,7 @@ egen(Node *n)
|
||||||
case OPLT: op = DTE_SLT; break;
|
case OPLT: op = DTE_SLT; break;
|
||||||
case OPLE: op = DTE_SLE; break;
|
case OPLE: op = DTE_SLE; break;
|
||||||
case OPXNOR: op = DTE_XNOR; break;
|
case OPXNOR: op = DTE_XNOR; break;
|
||||||
default: sysfatal("egen: unknown op %d", n->op); return 0;
|
default: sysfatal("egen: unknown op %d", n->op);
|
||||||
}
|
}
|
||||||
r1 = egen(n->n1);
|
r1 = egen(n->n1);
|
||||||
r2 = egen(n->n2);
|
r2 = egen(n->n2);
|
||||||
|
@ -240,7 +240,7 @@ egen(Node *n)
|
||||||
}
|
}
|
||||||
case ORECORD:
|
case ORECORD:
|
||||||
case OSTR:
|
case OSTR:
|
||||||
default: sysfatal("egen: unknown type %α", n->type); return 0;
|
default: sysfatal("egen: unknown type %α", n->type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@ tracegen(Node *n, DTActGr *g, int *recoff)
|
||||||
n->num = *recoff;
|
n->num = *recoff;
|
||||||
*recoff += n->typ->size;
|
*recoff += n->typ->size;
|
||||||
return n;
|
return n;
|
||||||
default: sysfatal("tracegen: unknown type %α", n->type); return nil;
|
default: sysfatal("tracegen: unknown type %α", n->type);
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
|
@ -385,10 +385,10 @@ type(int typ, ...)
|
||||||
case 0x41: return &typs32;
|
case 0x41: return &typs32;
|
||||||
case 0x80: return &typu64;
|
case 0x80: return &typu64;
|
||||||
case 0x81: return &typs64;
|
case 0x81: return &typs64;
|
||||||
default: sysfatal("type: invalid (size,sign) = (%d,%d)\n", size, sign); return nil;
|
default: sysfatal("type: invalid (size,sign) = (%d,%d)\n", size, sign);
|
||||||
}
|
}
|
||||||
case TYPSTRING: return &typstr;
|
case TYPSTRING: return &typstr;
|
||||||
case TYPPTR: return mkptr(va_arg(va, Type *));
|
case TYPPTR: return mkptr(va_arg(va, Type *));
|
||||||
default: sysfatal("type: unknown %t", typ); return nil;
|
default: sysfatal("type: unknown %t", typ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,7 +205,6 @@ evalop(int op, int sign, vlong v1, vlong v2)
|
||||||
case OPLOR: return v1 || v2; break;
|
case OPLOR: return v1 || v2; break;
|
||||||
default:
|
default:
|
||||||
sysfatal("cfold: unknown op %.2x", op);
|
sysfatal("cfold: unknown op %.2x", op);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -289,7 +288,7 @@ calcrecsize(Node *n)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: sysfatal("calcrecsize: unknown symbol type %d", n->sym->type); return nil;
|
default: sysfatal("calcrecsize: unknown symbol type %d", n->sym->type);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OBIN:
|
case OBIN:
|
||||||
|
@ -315,7 +314,7 @@ calcrecsize(Node *n)
|
||||||
n->recsize = min(n->typ->size, n->n1->recsize + n->n2->recsize + n->n3->recsize);
|
n->recsize = min(n->typ->size, n->n1->recsize + n->n2->recsize + n->n3->recsize);
|
||||||
break;
|
break;
|
||||||
case ORECORD:
|
case ORECORD:
|
||||||
default: sysfatal("calcrecsize: unknown type %α", n->type); return nil;
|
default: sysfatal("calcrecsize: unknown type %α", n->type);
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
@ -347,7 +346,7 @@ insrecord(Node *n)
|
||||||
n->n3 = insrecord(n->n3);
|
n->n3 = insrecord(n->n3);
|
||||||
break;
|
break;
|
||||||
case ORECORD:
|
case ORECORD:
|
||||||
default: sysfatal("insrecord: unknown type %α", n->type); return nil;
|
default: sysfatal("insrecord: unknown type %α", n->type);
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
|
@ -605,7 +605,6 @@ openmount(int sfd)
|
||||||
arg[0] = "/bin/exportfs";
|
arg[0] = "/bin/exportfs";
|
||||||
exec(arg[0], arg);
|
exec(arg[0], arg);
|
||||||
_exits("whoops: exec failed");
|
_exits("whoops: exec failed");
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -246,7 +246,6 @@ lex(char **s)
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
sysfatal("syntax error at %s", *s);
|
sysfatal("syntax error at %s", *s);
|
||||||
return nil;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -1217,10 +1217,8 @@ indexpack(char *pack, char *idx, Hash ph)
|
||||||
if(objectcrc(f, o) == -1)
|
if(objectcrc(f, o) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if(n == nvalid){
|
if(n == nvalid)
|
||||||
sysfatal("fix point reached too early: %d/%d: %r", nvalid, nobj);
|
sysfatal("fix point reached too early: %d/%d: %r", nvalid, nobj);
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
nvalid = n;
|
nvalid = n;
|
||||||
}
|
}
|
||||||
if(interactive)
|
if(interactive)
|
||||||
|
|
|
@ -536,7 +536,6 @@ findCDir(Biobuf *bin, char *file)
|
||||||
if(ecoff < 0){
|
if(ecoff < 0){
|
||||||
fprint(2, "unzip: can't seek to contents of %s\n", file);
|
fprint(2, "unzip: can't seek to contents of %s\n", file);
|
||||||
longjmp(seekjmp, 1);
|
longjmp(seekjmp, 1);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
if(setjmp(zjmp))
|
if(setjmp(zjmp))
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -545,7 +544,6 @@ findCDir(Biobuf *bin, char *file)
|
||||||
if(ecoff <= 0 || off >= 1024){
|
if(ecoff <= 0 || off >= 1024){
|
||||||
fprint(2, "unzip: cannot find end of table of contents in %s\n", file);
|
fprint(2, "unzip: cannot find end of table of contents in %s\n", file);
|
||||||
longjmp(seekjmp, 1);
|
longjmp(seekjmp, 1);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
off++;
|
off++;
|
||||||
ecoff--;
|
ecoff--;
|
||||||
|
@ -572,7 +570,6 @@ findCDir(Biobuf *bin, char *file)
|
||||||
if(Bseek(bin, off, 0) != off){
|
if(Bseek(bin, off, 0) != off){
|
||||||
fprint(2, "unzip: can't seek to start of contents of %s\n", file);
|
fprint(2, "unzip: can't seek to start of contents of %s\n", file);
|
||||||
longjmp(seekjmp, 1);
|
longjmp(seekjmp, 1);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return entries;
|
return entries;
|
||||||
|
|
|
@ -50,10 +50,8 @@ void*
|
||||||
erealloc(void *v, ulong sz)
|
erealloc(void *v, ulong sz)
|
||||||
{
|
{
|
||||||
v = realloc(v, sz);
|
v = realloc(v, sz);
|
||||||
if(v == nil){
|
if(v == nil)
|
||||||
sysfatal("realloc: %r");
|
sysfatal("realloc: %r");
|
||||||
threadexitsall("memory");
|
|
||||||
}
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -194,10 +194,8 @@ top:
|
||||||
goto top;
|
goto top;
|
||||||
}
|
}
|
||||||
r = c;
|
r = c;
|
||||||
}else{
|
}else
|
||||||
r = 0;
|
|
||||||
sysfatal("getrune - can't happen");
|
sysfatal("getrune - can't happen");
|
||||||
}
|
|
||||||
if(r == '\n')
|
if(r == '\n')
|
||||||
istack->lineno++;
|
istack->lineno++;
|
||||||
return r;
|
return r;
|
||||||
|
|
|
@ -165,7 +165,6 @@ setup(int *v6net, int *tunp)
|
||||||
|
|
||||||
cl = smprint("%s/ipifc/clone", inside);
|
cl = smprint("%s/ipifc/clone", inside);
|
||||||
cfd = open(cl, ORDWR); /* allocate a conversation */
|
cfd = open(cl, ORDWR); /* allocate a conversation */
|
||||||
n = 0;
|
|
||||||
if (cfd < 0 || (n = read(cfd, buf, sizeof buf - 1)) <= 0)
|
if (cfd < 0 || (n = read(cfd, buf, sizeof buf - 1)) <= 0)
|
||||||
sysfatal("can't make packet interface %s: %r", cl);
|
sysfatal("can't make packet interface %s: %r", cl);
|
||||||
if (debug)
|
if (debug)
|
||||||
|
|
|
@ -339,7 +339,6 @@ setup(int *v6net)
|
||||||
|
|
||||||
cl = smprint("%s/ipifc/clone", inside);
|
cl = smprint("%s/ipifc/clone", inside);
|
||||||
cfd = open(cl, ORDWR); /* allocate a conversation */
|
cfd = open(cl, ORDWR); /* allocate a conversation */
|
||||||
n = 0;
|
|
||||||
if (cfd < 0 || (n = read(cfd, buf, sizeof buf - 1)) <= 0)
|
if (cfd < 0 || (n = read(cfd, buf, sizeof buf - 1)) <= 0)
|
||||||
sysfatal("can't make packet interface %s: %r", cl);
|
sysfatal("can't make packet interface %s: %r", cl);
|
||||||
if (debug)
|
if (debug)
|
||||||
|
|
|
@ -87,12 +87,10 @@ receive(uchar *h, uchar *e)
|
||||||
&r.cmd, &r.flags, &r.flags2, &hpid, &sig, &r.tid, &r.pid, &r.uid, &r.mid)) == 0){
|
&r.cmd, &r.flags, &r.flags2, &hpid, &sig, &r.tid, &r.pid, &r.uid, &r.mid)) == 0){
|
||||||
logit("bad smb header");
|
logit("bad smb header");
|
||||||
exits("botch");
|
exits("botch");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if(magic != MAGIC) {
|
if(magic != MAGIC) {
|
||||||
logit("bad smb magic [%x] %s", magic, (magic == MAGIC_SMB2 ? "(SMB2/3 not supported)" : ""));
|
logit("bad smb magic [%x] %s", magic, (magic == MAGIC_SMB2 ? "(SMB2/3 not supported)" : ""));
|
||||||
exits("botch");
|
exits("botch");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
r.pid |= hpid<<16;
|
r.pid |= hpid<<16;
|
||||||
r.lh = buffer;
|
r.lh = buffer;
|
||||||
|
|
|
@ -253,7 +253,6 @@ kaproc(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
_exits(0);
|
_exits(0);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -131,7 +131,6 @@ main(int argc, char **argv)
|
||||||
if(htmlfd < 0 || (dir = dirfstat(htmlfd)) == nil){
|
if(htmlfd < 0 || (dir = dirfstat(htmlfd)) == nil){
|
||||||
hfail(c, HNotFound, c->req.uri);
|
hfail(c, HNotFound, c->req.uri);
|
||||||
exits("failed");
|
exits("failed");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
snprint(fn, nfn, "/usr/web/save/%s.data", c->req.uri);
|
snprint(fn, nfn, "/usr/web/save/%s.data", c->req.uri);
|
||||||
|
|
|
@ -701,7 +701,6 @@ thread(void(*f)(void*), void *a)
|
||||||
return pid;
|
return pid;
|
||||||
(*f)(a);
|
(*f)(a);
|
||||||
_exits(nil);
|
_exits(nil);
|
||||||
return 0; // never reaches here
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -251,7 +251,6 @@ _filterpkt(Filter *f, Msg *m)
|
||||||
return _filterpkt(f->l, m);
|
return _filterpkt(f->l, m);
|
||||||
}
|
}
|
||||||
sysfatal("internal error: filterpkt op: %d", f->op);
|
sysfatal("internal error: filterpkt op: %d", f->op);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
int
|
int
|
||||||
filterpkt(Filter *f, uchar *ps, uchar *pe, Proto *pr, int needroot)
|
filterpkt(Filter *f, uchar *ps, uchar *pe, Proto *pr, int needroot)
|
||||||
|
|
|
@ -628,7 +628,6 @@ conssim(void)
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
exits(0);
|
exits(0);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -144,10 +144,8 @@ zread(void *va)
|
||||||
}
|
}
|
||||||
if(type[0] & PropertyBit)
|
if(type[0] & PropertyBit)
|
||||||
goto Again; /* skip auxiliary chunks fornow */
|
goto Again; /* skip auxiliary chunks fornow */
|
||||||
if(strcmp(type,"IDAT")){
|
if(strcmp(type,"IDAT"))
|
||||||
sysfatal("unrecognized mandatory chunk %s", type);
|
sysfatal("unrecognized mandatory chunk %s", type);
|
||||||
goto Again;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return *z->p++;
|
return *z->p++;
|
||||||
}
|
}
|
||||||
|
@ -407,7 +405,6 @@ readslave(Biobuf *b)
|
||||||
|
|
||||||
bpc = *h++;
|
bpc = *h++;
|
||||||
colorfmt = *h++;
|
colorfmt = *h++;
|
||||||
nchan = 0;
|
|
||||||
if(*h++ != 0)
|
if(*h++ != 0)
|
||||||
sysfatal("only deflate supported for now [%d]", h[-1]);
|
sysfatal("only deflate supported for now [%d]", h[-1]);
|
||||||
if(*h++ != FilterNone)
|
if(*h++ != FilterNone)
|
||||||
|
@ -417,7 +414,6 @@ readslave(Biobuf *b)
|
||||||
|
|
||||||
image = pngmalloc(sizeof(Rawimage), 1);
|
image = pngmalloc(sizeof(Rawimage), 1);
|
||||||
image->r = Rect(0, 0, dx, dy);
|
image->r = Rect(0, 0, dx, dy);
|
||||||
nout = 0;
|
|
||||||
switch(colorfmt){
|
switch(colorfmt){
|
||||||
case 0: /* grey */
|
case 0: /* grey */
|
||||||
if(bpc != 1 && bpc != 2 && bpc != 4 && bpc != 8 && bpc != 16)
|
if(bpc != 1 && bpc != 2 && bpc != 4 && bpc != 8 && bpc != 16)
|
||||||
|
|
|
@ -566,7 +566,6 @@ gifmalloc(ulong sz)
|
||||||
v = malloc(sz);
|
v = malloc(sz);
|
||||||
if(v == nil) {
|
if(v == nil) {
|
||||||
fprint(2, "WriteGIF: out of memory allocating %ld\n", sz);
|
fprint(2, "WriteGIF: out of memory allocating %ld\n", sz);
|
||||||
abort();
|
|
||||||
exits("mem");
|
exits("mem");
|
||||||
}
|
}
|
||||||
memset(v, 0, sz);
|
memset(v, 0, sz);
|
||||||
|
|
|
@ -236,5 +236,4 @@ vaddr(ulong addr)
|
||||||
}
|
}
|
||||||
Bprint(bioout, "data_access_MMU_miss [addr 0x%.8lux]\n", addr);
|
Bprint(bioout, "data_access_MMU_miss [addr 0x%.8lux]\n", addr);
|
||||||
longjmp(errjmp, 0);
|
longjmp(errjmp, 0);
|
||||||
return 0; /*to stop compiler whining*/
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -437,7 +437,6 @@ extern ulong target;
|
||||||
|
|
||||||
RR* getdnsservers(int);
|
RR* getdnsservers(int);
|
||||||
|
|
||||||
void abort(); /* char*, ... */;
|
|
||||||
void addserver(Server**, char*);
|
void addserver(Server**, char*);
|
||||||
int bslashfmt(Fmt*);
|
int bslashfmt(Fmt*);
|
||||||
Server* copyserverlist(Server*);
|
Server* copyserverlist(Server*);
|
||||||
|
|
|
@ -333,7 +333,6 @@ hunk:
|
||||||
switch(ln[0]){
|
switch(ln[0]){
|
||||||
default:
|
default:
|
||||||
sysfatal("%s:%d: malformed hunk: leading junk", name, lnum);
|
sysfatal("%s:%d: malformed hunk: leading junk", name, lnum);
|
||||||
goto out;
|
|
||||||
case '\\':
|
case '\\':
|
||||||
if(strncmp(ln, "\\ No newline", nelem("\\ No newline")-1) == 0)
|
if(strncmp(ln, "\\ No newline", nelem("\\ No newline")-1) == 0)
|
||||||
trimhunk(c, &h);
|
trimhunk(c, &h);
|
||||||
|
@ -563,7 +562,6 @@ char*
|
||||||
searchln(Fbuf *f, Hunk *h, int ln)
|
searchln(Fbuf *f, Hunk *h, int ln)
|
||||||
{
|
{
|
||||||
int off;
|
int off;
|
||||||
int n;
|
|
||||||
|
|
||||||
off = f->lines[ln];
|
off = f->lines[ln];
|
||||||
if(off + h->oldlen > f->len)
|
if(off + h->oldlen > f->len)
|
||||||
|
@ -601,7 +599,6 @@ search(Fbuf *f, Hunk *h, char *fname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sysfatal("%s:%d: unable to find hunk offset in %s", fname, h->lnum, h->oldpath);
|
sysfatal("%s:%d: unable to find hunk offset in %s", fname, h->lnum, h->oldpath);
|
||||||
return nil;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char*
|
char*
|
||||||
|
|
|
@ -66,10 +66,8 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
if (argc > 0) {
|
if (argc > 0) {
|
||||||
close(0);
|
close(0);
|
||||||
if (open(argv[0], 0) != 0) {
|
if (open(argv[0], 0) != 0)
|
||||||
sysfatal("can't open %s: %r", argv[0]);
|
sysfatal("can't open %s: %r", argv[0]);
|
||||||
exits("open failure");
|
|
||||||
}
|
|
||||||
if(dotrack)
|
if(dotrack)
|
||||||
track = argv[0];
|
track = argv[0];
|
||||||
}
|
}
|
||||||
|
|
|
@ -468,7 +468,6 @@ fcmp(ulong ir)
|
||||||
if(trace)
|
if(trace)
|
||||||
itrace("fcmpo\tcr%d,f%d,f%d", rd, ra, rb);
|
itrace("fcmpo\tcr%d,f%d,f%d", rd, ra, rb);
|
||||||
if(isNaN(reg.fd[ra]) || isNaN(reg.fd[rb])) { /* BUG: depends whether quiet or signalling ... */
|
if(isNaN(reg.fd[ra]) || isNaN(reg.fd[rb])) { /* BUG: depends whether quiet or signalling ... */
|
||||||
fc = CRFU;
|
|
||||||
Bprint(bioout, "invalid_fp_register\n");
|
Bprint(bioout, "invalid_fp_register\n");
|
||||||
longjmp(errjmp, 0);
|
longjmp(errjmp, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -267,5 +267,4 @@ vaddr(ulong addr)
|
||||||
}
|
}
|
||||||
Bprint(bioout, "data_access_MMU_miss [addr 0x%.8lux]\n", addr);
|
Bprint(bioout, "data_access_MMU_miss [addr 0x%.8lux]\n", addr);
|
||||||
longjmp(errjmp, 0);
|
longjmp(errjmp, 0);
|
||||||
return 0; /*to stop compiler whining*/
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -335,8 +335,6 @@ shutdown(void *, char *msg)
|
||||||
}
|
}
|
||||||
fprint(2, "rio %d: abort: %s\n", getpid(), msg);
|
fprint(2, "rio %d: abort: %s\n", getpid(), msg);
|
||||||
abort();
|
abort();
|
||||||
exits(msg);
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -228,7 +228,6 @@ send(int fd)
|
||||||
write(fd, buf, 0);
|
write(fd, buf, 0);
|
||||||
|
|
||||||
exits(0);
|
exits(0);
|
||||||
return 0; /* to keep compiler happy */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -235,7 +235,6 @@ out:
|
||||||
return t != TEOF;
|
return t != TEOF;
|
||||||
syntax:
|
syntax:
|
||||||
sysfatal("syntax error");
|
sysfatal("syntax error");
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int oneflag, multiflag;
|
int oneflag, multiflag;
|
||||||
|
|
|
@ -40,7 +40,6 @@ static int no_box;
|
||||||
extern int ntrail, s_trail, pno, depth;
|
extern int ntrail, s_trail, pno, depth;
|
||||||
extern Symbol *oFname;
|
extern Symbol *oFname;
|
||||||
|
|
||||||
extern void exit(int);
|
|
||||||
extern void putpostlude(void);
|
extern void putpostlude(void);
|
||||||
|
|
||||||
static void putpages(void);
|
static void putpages(void);
|
||||||
|
|
|
@ -95,7 +95,6 @@ void a_stats(void);
|
||||||
void addtrans(Graph *, char *, Node *, char *);
|
void addtrans(Graph *, char *, Node *, char *);
|
||||||
void cache_stats(void);
|
void cache_stats(void);
|
||||||
void dump(Node *);
|
void dump(Node *);
|
||||||
void exit(int);
|
|
||||||
void Fatal(char *, char *);
|
void Fatal(char *, char *);
|
||||||
void fatal(char *, char *);
|
void fatal(char *, char *);
|
||||||
void fsm_print(void);
|
void fsm_print(void);
|
||||||
|
|
|
@ -273,10 +273,8 @@ sendpkt(char *fmt, ...)
|
||||||
va_start(a, fmt);
|
va_start(a, fmt);
|
||||||
n = vpack(send.b, sizeof(send.b), fmt, a);
|
n = vpack(send.b, sizeof(send.b), fmt, a);
|
||||||
va_end(a);
|
va_end(a);
|
||||||
if(n < 0) {
|
if(n < 0)
|
||||||
toobig: sysfatal("sendpkt: message too big");
|
toobig: sysfatal("sendpkt: message too big");
|
||||||
return;
|
|
||||||
}
|
|
||||||
send.r = send.b;
|
send.r = send.b;
|
||||||
send.w = send.b+n;
|
send.w = send.b+n;
|
||||||
|
|
||||||
|
@ -978,7 +976,6 @@ dispatch(void)
|
||||||
if(unpack(recv.r, recv.w-recv.r, "_us", &c, &s, &n) < 0)
|
if(unpack(recv.r, recv.w-recv.r, "_us", &c, &s, &n) < 0)
|
||||||
break;
|
break;
|
||||||
sysfatal("disconnect: (%d) %.*s", c, utfnlen(s, n), s);
|
sysfatal("disconnect: (%d) %.*s", c, utfnlen(s, n), s);
|
||||||
return;
|
|
||||||
case MSG_DEBUG:
|
case MSG_DEBUG:
|
||||||
if(unpack(recv.r, recv.w-recv.r, "__sb", &s, &n, &c) < 0)
|
if(unpack(recv.r, recv.w-recv.r, "__sb", &s, &n, &c) < 0)
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -358,10 +358,8 @@ sendpkt(char *fmt, ...)
|
||||||
va_start(a, fmt);
|
va_start(a, fmt);
|
||||||
n = vpack(buf+4, sizeof(buf)-4, fmt, a);
|
n = vpack(buf+4, sizeof(buf)-4, fmt, a);
|
||||||
va_end(a);
|
va_end(a);
|
||||||
if(n < 0) {
|
if(n < 0)
|
||||||
sysfatal("sendpkt: message too big");
|
sysfatal("sendpkt: message too big");
|
||||||
return;
|
|
||||||
}
|
|
||||||
PUT4(buf, n);
|
PUT4(buf, n);
|
||||||
n += 4;
|
n += 4;
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,6 @@ rdmagic(void)
|
||||||
return rdsysiii;
|
return rdsysiii;
|
||||||
|
|
||||||
sysfatal("Out of phase--get MERT help");
|
sysfatal("Out of phase--get MERT help");
|
||||||
return nil;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -181,7 +181,6 @@ conv(char *name, int from)
|
||||||
return(c);
|
return(c);
|
||||||
}
|
}
|
||||||
sysfatal("charset `%s' unknown", name);
|
sysfatal("charset `%s' unknown", name);
|
||||||
return(0); /* just shut the compiler up */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -490,7 +490,6 @@ setnum(Biobuf *b, char *name, int min, int max)
|
||||||
if(min<=i && i<max)
|
if(min<=i && i<max)
|
||||||
return i;
|
return i;
|
||||||
sysfatal("value of %s is %d; min %d max %d at %s:#%d", name, i, min, max, filename, cno);
|
sysfatal("value of %s is %d; min %d max %d at %s:#%d", name, i, min, max, filename, cno);
|
||||||
return i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -18,7 +18,6 @@ main(int argc, char *argv[])
|
||||||
mtpt = argv[2];
|
mtpt = argv[2];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SET(mnted, mtpt);
|
|
||||||
fprint(2, "usage: unmount mountpoint\n");
|
fprint(2, "usage: unmount mountpoint\n");
|
||||||
fprint(2, " unmount mounted mountpoint\n");
|
fprint(2, " unmount mounted mountpoint\n");
|
||||||
exits("usage");
|
exits("usage");
|
||||||
|
|
|
@ -743,7 +743,6 @@ egetnum(Biobuf *b, int want, jmp_buf jb)
|
||||||
}
|
}
|
||||||
werrstr("unexpected eof");
|
werrstr("unexpected eof");
|
||||||
longjmp(jb, 1);
|
longjmp(jb, 1);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Dreprog*
|
Dreprog*
|
||||||
|
|
|
@ -34,7 +34,6 @@ getfolder(Biobuf *out)
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
sysfatal("folder.c:ftab too small");
|
sysfatal("folder.c:ftab too small");
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -51,7 +51,6 @@ opendeliver(int *pip, char *folder, char *from, long t)
|
||||||
exec("/bin/upas/mbappend", av);
|
exec("/bin/upas/mbappend", av);
|
||||||
ilog("exec: %r");
|
ilog("exec: %r");
|
||||||
_exits("b0rked");
|
_exits("b0rked");
|
||||||
return -1;
|
|
||||||
default:
|
default:
|
||||||
*pip = fd[0];
|
*pip = fd[0];
|
||||||
close(fd[1]);
|
close(fd[1]);
|
||||||
|
|
|
@ -21,7 +21,6 @@ openpipe(int *pip, char *cmd, char *av[])
|
||||||
exec(cmd, av);
|
exec(cmd, av);
|
||||||
ilog("exec: %r");
|
ilog("exec: %r");
|
||||||
_exits("b0rked");
|
_exits("b0rked");
|
||||||
return -1;
|
|
||||||
default:
|
default:
|
||||||
*pip = fd[0];
|
*pip = fd[0];
|
||||||
close(fd[1]);
|
close(fd[1]);
|
||||||
|
|
|
@ -157,9 +157,6 @@ startmailer(char *name)
|
||||||
av[ac] = 0;
|
av[ac] = 0;
|
||||||
exec("/bin/upas/send", av);
|
exec("/bin/upas/send", av);
|
||||||
sysfatal("execing mailer: %r");
|
sysfatal("execing mailer: %r");
|
||||||
|
|
||||||
/* not reached */
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -488,7 +488,6 @@ quitcmd(char*)
|
||||||
{
|
{
|
||||||
synccmd(nil);
|
synccmd(nil);
|
||||||
exits(nil);
|
exits(nil);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -28,7 +28,6 @@ refuse(dest*, message *, char *cp, int, int)
|
||||||
{
|
{
|
||||||
fprint(2, "%s\n", cp);
|
fprint(2, "%s\n", cp);
|
||||||
exits("error");
|
exits("error");
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -474,7 +474,6 @@ hello(String *himp, int extended)
|
||||||
rejectcount++;
|
rejectcount++;
|
||||||
reply("554 5.7.0 Liar!\r\n");
|
reply("554 5.7.0 Liar!\r\n");
|
||||||
exits("client pretended to be us");
|
exits("client pretended to be us");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strchr(him, '.') == 0 && nci != nil && strchr(nci->rsys, '.') != nil)
|
if(strchr(him, '.') == 0 && nci != nil && strchr(nci->rsys, '.') != nil)
|
||||||
|
|
|
@ -131,7 +131,6 @@ loadexcludefile(char *file)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
inc = 0;
|
|
||||||
if(strncmp(p, "include ", 8) == 0){
|
if(strncmp(p, "include ", 8) == 0){
|
||||||
inc = 1;
|
inc = 1;
|
||||||
}else if(strncmp(p, "exclude ", 8) == 0){
|
}else if(strncmp(p, "exclude ", 8) == 0){
|
||||||
|
|
|
@ -162,7 +162,6 @@ walk(uchar score[VtScoreSize], uint type, int base)
|
||||||
}
|
}
|
||||||
if(!rewrite && memcmp(score, nscore, VtScoreSize) != 0){
|
if(!rewrite && memcmp(score, nscore, VtScoreSize) != 0){
|
||||||
fprint(2, "not rewriting: wrote %V got %V\n", score, nscore);
|
fprint(2, "not rewriting: wrote %V got %V\n", score, nscore);
|
||||||
abort();
|
|
||||||
sysfatal("not rewriting: wrote %V got %V", score, nscore);
|
sysfatal("not rewriting: wrote %V got %V", score, nscore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -235,7 +235,6 @@ _packarena(Arena *arena, u8int *buf, int forceext)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sysfatal("packarena unknown version %d", arena->version);
|
sysfatal("packarena unknown version %d", arena->version);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p = buf;
|
p = buf;
|
||||||
|
@ -370,7 +369,6 @@ packarenahead(ArenaHead *head, u8int *buf)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sysfatal("packarenahead unknown version %d", head->version);
|
sysfatal("packarenahead unknown version %d", head->version);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p = buf;
|
p = buf;
|
||||||
|
|
|
@ -1472,7 +1472,6 @@ opirr(int a)
|
||||||
case AADDVU: return SP(3,1);
|
case AADDVU: return SP(3,1);
|
||||||
}
|
}
|
||||||
diag("bad irr %d", a);
|
diag("bad irr %d", a);
|
||||||
abort();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -691,7 +691,6 @@ obsdcmdline(int argc, char **argv)
|
||||||
usage:
|
usage:
|
||||||
fprint(2, "openbsd cmdline usage: kernel [-asdc] [var=value ...]\nsupported vars: device tty db_console\n");
|
fprint(2, "openbsd cmdline usage: kernel [-asdc] [var=value ...]\nsupported vars: device tty db_console\n");
|
||||||
threadexitsall("usage");
|
threadexitsall("usage");
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -74,7 +74,6 @@ main(int argc, char *argv[])
|
||||||
Binit(&bout, 1, OWRITE);
|
Binit(&bout, 1, OWRITE);
|
||||||
Blethal(&bout, nil);
|
Blethal(&bout, nil);
|
||||||
err = 0;
|
err = 0;
|
||||||
ap = 0;
|
|
||||||
while(argc>1 && argv[1][0]=='-' && argv[1][1]){
|
while(argc>1 && argv[1][0]=='-' && argv[1][1]){
|
||||||
--argc;
|
--argc;
|
||||||
argv++;
|
argv++;
|
||||||
|
|
|
@ -133,7 +133,6 @@ getcmd(char *l)
|
||||||
return cmd;
|
return cmd;
|
||||||
}
|
}
|
||||||
sysfatal("getcmd: no such command %s", l);
|
sysfatal("getcmd: no such command %s", l);
|
||||||
return NOCMD;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -551,5 +551,4 @@ step(void)
|
||||||
case 0xff: return call(0x38, -1);
|
case 0xff: return call(0x38, -1);
|
||||||
}
|
}
|
||||||
sysfatal("undefined opcode %#.2x at pc=%#.4x", op, curpc);
|
sysfatal("undefined opcode %#.2x at pc=%#.4x", op, curpc);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,7 +150,6 @@ typename(char *s, int type, int size)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sysfatal("typestr: unknown type %d -- shouldn't happen", type);
|
sysfatal("typestr: unknown type %d -- shouldn't happen", type);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
snprint(s, BACKTYPELEN, "%s%d%s", st, size/128, id);
|
snprint(s, BACKTYPELEN, "%s%d%s", st, size/128, id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,7 +325,6 @@ checknext(int dir, int x, int y)
|
||||||
default:
|
default:
|
||||||
sysfatal("andrey messed up big time");
|
sysfatal("andrey messed up big time");
|
||||||
}
|
}
|
||||||
return 1000;
|
|
||||||
}
|
}
|
||||||
/* the following two routines constitute the "game AI"
|
/* the following two routines constitute the "game AI"
|
||||||
* they score the field based on the number of moves
|
* they score the field based on the number of moves
|
||||||
|
|
|
@ -45,7 +45,6 @@ regread(u16int a)
|
||||||
return (~z80bus & BUSACK) >> 1;
|
return (~z80bus & BUSACK) >> 1;
|
||||||
}
|
}
|
||||||
sysfatal("read from 0xa1%.4ux (pc=%#.6ux)", a, curpc);
|
sysfatal("read from 0xa1%.4ux (pc=%#.6ux)", a, curpc);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -191,7 +190,6 @@ memread(u32int a)
|
||||||
default:
|
default:
|
||||||
invalid:
|
invalid:
|
||||||
sysfatal("read from %#.6ux (pc=%#.6ux)", a, curpc);
|
sysfatal("read from %#.6ux (pc=%#.6ux)", a, curpc);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -503,7 +503,6 @@ ed(void)
|
||||||
case 0x4f: return 9;
|
case 0x4f: return 9;
|
||||||
}
|
}
|
||||||
sysfatal("undefined z80 opcode ed%.2x at pc=%#.4x", op, scurpc);
|
sysfatal("undefined z80 opcode ed%.2x at pc=%#.4x", op, scurpc);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -579,7 +578,6 @@ index(int n)
|
||||||
case 0x2e: ix[n] = ix[n] & 0xff00 | fetch8(); return 11;
|
case 0x2e: ix[n] = ix[n] & 0xff00 | fetch8(); return 11;
|
||||||
}
|
}
|
||||||
sysfatal("undefined z80 opcode %.2x%.2x at pc=%#.4x", n ? 0xfd : 0xdd, op, scurpc);
|
sysfatal("undefined z80 opcode %.2x%.2x at pc=%#.4x", n ? 0xfd : 0xdd, op, scurpc);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -817,5 +815,4 @@ z80step(void)
|
||||||
case 0xff: return call(0x38, 1);
|
case 0xff: return call(0x38, 1);
|
||||||
}
|
}
|
||||||
sysfatal("undefined z80 opcode %#.2x at pc=%#.4x", op, scurpc);
|
sysfatal("undefined z80 opcode %#.2x at pc=%#.4x", op, scurpc);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue