FreeBSD tweaks

This commit is contained in:
rsc 2004-12-28 17:34:05 +00:00
parent d54ead7fb9
commit f7b74c1725
11 changed files with 26 additions and 22 deletions

View file

@ -614,10 +614,13 @@ summary(void)
void void
error(char *s, ...) error(char *s, ...)
{ {
va_list arg;
nerrors++; nerrors++;
fprint(2, "\n fatal error:"); fprint(2, "\n fatal error:");
fprint(2, s, (&s)[1]); va_start(arg, s);
vfprint(2, s, arg);
va_end(arg);
fprint(2, ", %s:%d\n", infile, lineno); fprint(2, ", %s:%d\n", infile, lineno);
if(!fatfl) if(!fatfl)
return; return;
@ -2629,7 +2632,7 @@ callopt(void)
case '$': case '$':
break; break;
default: default:
error("bad tempfile"); error("bad tempfile %s", tempname);
} }
break; break;
} }

View file

@ -52,7 +52,7 @@ dumbmap(int fd)
void void
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
Lsym *l; Lsym *volatile l;
Node *n; Node *n;
char buf[128], *s; char buf[128], *s;
int pid, i; int pid, i;
@ -173,7 +173,8 @@ main(int argc, char *argv[])
static int static int
attachfiles(int argc, char **argv) attachfiles(int argc, char **argv)
{ {
int fd, pid; int fd;
volatile int pid;
char *s; char *s;
int i, omode; int i, omode;
Fhdr *hdr; Fhdr *hdr;

View file

@ -600,8 +600,9 @@ out:
int int
stabs2acid(Stab *stabs, Biobuf *b) stabs2acid(Stab *stabs, Biobuf *b)
{ {
int fno, i; volatile int fno, i;
char c, *dir, *fn, *file, *name, *desc, *p; char c, *file, *desc, *p;
char *volatile dir, *volatile fn, *volatile name;
Ftypes *f; Ftypes *f;
Type *t, *tt; Type *t, *tt;
StabSym sym; StabSym sym;

View file

@ -88,7 +88,6 @@ xnet(int first)
struct ifnet ifnet; struct ifnet ifnet;
struct ifnethead ifnethead; struct ifnethead ifnethead;
char name[16]; char name[16];
int n;
if(first) if(first)
return; return;

View file

@ -179,9 +179,9 @@ usage(void)
} }
void void
main(int argc, char *argv[]) main(volatile int argc, char **volatile argv)
{ {
int i; volatile int i;
Event e; Event e;
Thing *t; Thing *t;
@ -575,7 +575,7 @@ tget(char *file)
Image *b; Image *b;
Subfont *s; Subfont *s;
Thing *t; Thing *t;
Dir *d; Dir *volatile d;
jmp_buf oerr; jmp_buf oerr;
uchar buf[256]; uchar buf[256];
char *data; char *data;

View file

@ -135,7 +135,7 @@ static int
unztable(Biobuf *bin, char *file) unztable(Biobuf *bin, char *file)
{ {
ZipHead zh; ZipHead zh;
int entries; int volatile entries;
entries = findCDir(bin, file); entries = findCDir(bin, file);
if(entries < 0) if(entries < 0)
@ -273,7 +273,7 @@ unzip(Biobuf *bin, char *file)
{ {
ZipHead zh; ZipHead zh;
vlong off; vlong off;
int ok, eok, entries; int volatile ok, eok, entries;
entries = findCDir(bin, file); entries = findCDir(bin, file);
if(entries < 0) if(entries < 0)

View file

@ -45,9 +45,9 @@ usage(void)
} }
void void
main(int argc, char *argv[]) main(int volatile argc, char **volatile argv)
{ {
char *zfile; char *volatile zfile;
int i, fd, err; int i, fd, err;
zfile = nil; zfile = nil;

View file

@ -29,7 +29,8 @@ void
threadmain(int argc, char *argv[]) threadmain(int argc, char *argv[])
{ {
char buf[512]; char buf[512];
int fd, dofork; int fd;
int volatile dofork;
progname = "plumber"; progname = "plumber";
dofork = 1; dofork = 1;

View file

@ -1,5 +1,6 @@
#include <u.h> #include <u.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/stat.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <libc.h> #include <libc.h>
#include "rc.h" #include "rc.h"
@ -174,10 +175,7 @@ execumask(void)
n = strtol(argv[0], &p, 8); n = strtol(argv[0], &p, 8);
if(*p != 0 || p == argv[0]) if(*p != 0 || p == argv[0])
goto usage; goto usage;
if(umask(n) < 0){ umask(n);
fprint(mapfd(2), "umask: %r\n");
goto out;
}
goto out; goto out;
} }

View file

@ -38,9 +38,9 @@ void usage(void);
extern int notify(void(*)(void*,char*)); extern int notify(void(*)(void*,char*));
int int
main(int argc, char *argv[]) main(int volatile argc, char **volatile argv)
{ {
int i; int volatile i;
String *t; String *t;
char **ap, **arg; char **ap, **arg;

View file

@ -13,7 +13,8 @@ plan9(File *f, int type, String *s, int nest)
{ {
long l; long l;
int m; int m;
int pid, fd; int volatile pid;
int fd;
int retcode; int retcode;
int pipe1[2], pipe2[2]; int pipe1[2], pipe2[2];