ignore & before array
[unix-history] / usr / src / old / vpr / vpd.c
index a17bab8..b6d9e49 100644 (file)
@@ -4,17 +4,17 @@
  * vpd.c                                               updated %G%
  * Varian or Versatec printer daemon
  */
  * vpd.c                                               updated %G%
  * Varian or Versatec printer daemon
  */
-char vpdSCCSid[] = "@(#)vpd.c  1.3\t%G%";
+char vpdSCCSid[] = "@(#)vpd.c  1.5\t%G%";
 
 #include <stdio.h>
 #include <sys/param.h>
 
 #include <stdio.h>
 #include <sys/param.h>
-#include <dir.h>
+#include <sys/dir.h>
 #include <signal.h>
 #include <signal.h>
-#include <stat.h>
+#include <sys/stat.h>
 #include <sgtty.h>
 #include <errno.h>
 #include <sys/vcmd.h>
 #include <sgtty.h>
 #include <errno.h>
 #include <sys/vcmd.h>
-#include <wait.h>
+#include <sys/wait.h>
 
 int    debug;
 extern int errno;
 
 int    debug;
 extern int errno;
@@ -58,6 +58,8 @@ char  fonts[4][50] = {
 };
 
 main(argc, argv)
 };
 
 main(argc, argv)
+       int argc;
+       char **argv;
 {
        char n;
        register char *p1, *p2;
 {
        char n;
        register char *p1, *p2;
@@ -68,6 +70,22 @@ main(argc, argv)
        int offline = 0;
        int i, okreque = 1;
 
        int offline = 0;
        int i, okreque = 1;
 
+       while (argc > 1) {
+               argc--;
+               argv++;
+               if (argv[0][0] != '-')
+                       continue;
+               switch (argv[0][1]) {
+               case 'n':
+                       if (argc < 2)
+                               break;
+                       argv++;
+                       argc--;
+                       nice(atol(argv[0]));
+                       break;
+               }
+       }
+       setuid(getuid());
        signal(SIGHUP, SIG_IGN);
        signal(SIGINT, SIG_IGN);
        signal(SIGQUIT, SIG_IGN);
        signal(SIGHUP, SIG_IGN);
        signal(SIGINT, SIG_IGN);
        signal(SIGQUIT, SIG_IGN);