install approved copyright notice
[unix-history] / usr / src / usr.bin / error / main.c
index 36ec9e6..54924f6 100644 (file)
@@ -1,4 +1,30 @@
-static char *sccsid = "@(#)main.c      1.3 (Berkeley) %G%";
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef lint
+char copyright[] =
+"@(#) Copyright (c) 1980 Regents of the University of California.\n\
+ All rights reserved.\n";
+#endif /* not lint */
+
+#ifndef lint
+static char sccsid[] = "@(#)main.c     5.3 (Berkeley) %G%";
+#endif /* not lint */
+
 #include <stdio.h>
 #include <ctype.h>
 #include <signal.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <signal.h>
@@ -14,7 +40,7 @@ int   language = INCC;
 
 char   *currentfilename = "????";
 char   *processname;
 
 char   *currentfilename = "????";
 char   *processname;
-char   *im_on;                 /* my tty name */
+char   im_on[] = "/dev/tty";   /* my tty name */
 
 boolean        query = FALSE;          /* query the operator if touch files */
 boolean        notouch = FALSE;        /* don't touch ANY files */
 
 boolean        query = FALSE;          /* query the operator if touch files */
 boolean        notouch = FALSE;        /* don't touch ANY files */
@@ -97,15 +123,6 @@ main(argc, argv)
                case 's':       pr_summary = TRUE;      break;
                case 'v':       edit_files = TRUE;      break;
                case 'T':       terse = TRUE;   break;
                case 's':       pr_summary = TRUE;      break;
                case 'v':       edit_files = TRUE;      break;
                case 'T':       terse = TRUE;   break;
-#ifndef ERNIE
-               case 'p':
-                       *cp-- = 0; argv++; argc--;
-                       if (argc > 1){
-                               currentfilename = argv[1];
-                               piflag = TRUE;
-                       }
-                       break;
-#endif
                case 't':
                        *cp-- = 0; argv++; argc--;
                        if (argc > 1){
                case 't':
                        *cp-- = 0; argv++; argc--;
                        if (argc > 1){
@@ -133,11 +150,13 @@ main(argc, argv)
                        exit(4);
                }
        }
                        exit(4);
                }
        }
-       im_on = "/dev/tty";
        if ( (queryfile = fopen(im_on, "r")) == NULL){
        if ( (queryfile = fopen(im_on, "r")) == NULL){
-               fprintf(stderr,"%s: Can't open \"%s\" to query the user.\n",
-                       processname, im_on);
-               exit(9);
+               if (query){
+                       fprintf(stderr,
+                               "%s: Can't open \"%s\" to query the user.\n",
+                               processname, im_on);
+                       exit(9);
+               }
        }
        if (signal(SIGINT, onintr) == SIG_IGN)
                signal(SIGINT, SIG_IGN);
        }
        if (signal(SIGINT, onintr) == SIG_IGN)
                signal(SIGINT, SIG_IGN);