tFreeBSD tweaks - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
commit f7b74c1725b497df5ce836545c127ad565175c70
parent d54ead7fb922cfa661c7b7f0d0b2ba1251cdea7f
Author: rsc 
Date:   Tue, 28 Dec 2004 17:34:05 +0000

FreeBSD tweaks

Diffstat:
  M src/cmd/9yacc.c                     |       7 +++++--
  M src/cmd/acid/main.c                 |       5 +++--
  M src/cmd/acidtypes/stabs.c           |       5 +++--
  M src/cmd/auxstats/FreeBSD.c          |       1 -
  M src/cmd/draw/tweak.c                |       6 +++---
  M src/cmd/gzip/unzip.c                |       4 ++--
  M src/cmd/gzip/zip.c                  |       4 ++--
  M src/cmd/plumb/plumber.c             |       3 ++-
  M src/cmd/rc/unixcrap.c               |       6 ++----
  M src/cmd/sam/sam.c                   |       4 ++--
  M src/cmd/sam/shell.c                 |       3 ++-

11 files changed, 26 insertions(+), 22 deletions(-)
---
diff --git a/src/cmd/9yacc.c b/src/cmd/9yacc.c
t@@ -614,10 +614,13 @@ summary(void)
 void
 error(char *s, ...)
 {
+        va_list arg;
 
         nerrors++;
         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);
         if(!fatfl)
                 return;
t@@ -2629,7 +2632,7 @@ callopt(void)
                 case '$':
                         break;
                 default:
-                        error("bad tempfile");
+                        error("bad tempfile %s", tempname);
                 }
                 break;
         }
diff --git a/src/cmd/acid/main.c b/src/cmd/acid/main.c
t@@ -52,7 +52,7 @@ dumbmap(int fd)
 void
 main(int argc, char *argv[])
 {
-        Lsym *l;
+        Lsym *volatile l;
         Node *n;
         char buf[128], *s;
         int pid, i;
t@@ -173,7 +173,8 @@ main(int argc, char *argv[])
 static int
 attachfiles(int argc, char **argv)
 {
-        int fd, pid;
+        int fd;
+        volatile int pid;
         char *s;
         int i, omode;
         Fhdr *hdr;
diff --git a/src/cmd/acidtypes/stabs.c b/src/cmd/acidtypes/stabs.c
t@@ -600,8 +600,9 @@ out:
 int
 stabs2acid(Stab *stabs, Biobuf *b)
 {
-        int fno, i;
-        char c, *dir, *fn, *file, *name, *desc, *p;
+        volatile int fno, i;
+        char c, *file, *desc, *p;
+        char *volatile dir, *volatile fn, *volatile name;
         Ftypes *f;
         Type *t, *tt;
         StabSym sym;
diff --git a/src/cmd/auxstats/FreeBSD.c b/src/cmd/auxstats/FreeBSD.c
t@@ -88,7 +88,6 @@ xnet(int first)
         struct ifnet ifnet;
         struct ifnethead ifnethead;
         char name[16];
-        int n;
 
         if(first)
                 return;
diff --git a/src/cmd/draw/tweak.c b/src/cmd/draw/tweak.c
t@@ -179,9 +179,9 @@ usage(void)
 }
 
 void
-main(int argc, char *argv[])
+main(volatile int argc, char **volatile argv)
 {
-        int i;
+        volatile int i;
         Event e;
         Thing *t;
 
t@@ -575,7 +575,7 @@ tget(char *file)
         Image *b;
         Subfont *s;
         Thing *t;
-        Dir *d;
+        Dir *volatile d;
         jmp_buf oerr;
         uchar buf[256];
         char *data;
diff --git a/src/cmd/gzip/unzip.c b/src/cmd/gzip/unzip.c
t@@ -135,7 +135,7 @@ static int
 unztable(Biobuf *bin, char *file)
 {
         ZipHead zh;
-        int entries;
+        int volatile entries;
 
         entries = findCDir(bin, file);
         if(entries < 0)
t@@ -273,7 +273,7 @@ unzip(Biobuf *bin, char *file)
 {
         ZipHead zh;
         vlong off;
-        int ok, eok, entries;
+        int volatile ok, eok, entries;
 
         entries = findCDir(bin, file);
         if(entries < 0)
diff --git a/src/cmd/gzip/zip.c b/src/cmd/gzip/zip.c
t@@ -45,9 +45,9 @@ usage(void)
 }
 
 void
-main(int argc, char *argv[])
+main(int volatile argc, char **volatile argv)
 {
-        char *zfile;
+        char *volatile zfile;
         int i, fd, err;
 
         zfile = nil;
diff --git a/src/cmd/plumb/plumber.c b/src/cmd/plumb/plumber.c
t@@ -29,7 +29,8 @@ void
 threadmain(int argc, char *argv[])
 {
         char buf[512];
-        int fd, dofork;
+        int fd;
+        int volatile dofork;
 
         progname = "plumber";
         dofork = 1;
diff --git a/src/cmd/rc/unixcrap.c b/src/cmd/rc/unixcrap.c
t@@ -1,5 +1,6 @@
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "rc.h"
t@@ -174,10 +175,7 @@ execumask(void)
                 n = strtol(argv[0], &p, 8);
                 if(*p != 0 || p == argv[0])
                         goto usage;
-                if(umask(n) < 0){
-                        fprint(mapfd(2), "umask: %r\n");
-                        goto out;
-                }
+                umask(n);
                 goto out;
         }
 
diff --git a/src/cmd/sam/sam.c b/src/cmd/sam/sam.c
t@@ -38,9 +38,9 @@ void        usage(void);
 extern int notify(void(*)(void*,char*));
 
 int
-main(int argc, char *argv[])
+main(int volatile argc, char **volatile argv)
 {
-        int i;
+        int volatile i;
         String *t;
         char **ap, **arg;
 
diff --git a/src/cmd/sam/shell.c b/src/cmd/sam/shell.c
t@@ -13,7 +13,8 @@ plan9(File *f, int type, String *s, int nest)
 {
         long l;
         int m;
-        int pid, fd;
+        int volatile pid;
+        int fd;
         int retcode;
         int pipe1[2], pipe2[2];