add EGP
[unix-history] / usr / src / old / configttys / configttys.c
index 1db304e..bd9ab59 100644 (file)
@@ -1,3 +1,8 @@
+
+#ifndef        lint
+char sccsid[] = "@(#)configttys.c      4.4 (Berkeley) %G%";
+#endif
+
 /*
  * configttys - configure "tty" ports
  *
 /*
  * configttys - configure "tty" ports
  *
@@ -5,10 +10,6 @@
  * U.C.Berkeley
  */
 
  * U.C.Berkeley
  */
 
-#ifndef        lint
-char   sccsid[]        = "@(#)configttys.c     4.1 Berkeley %G%";
-#endif
-
 #include <stdio.h>
 #include <getty.h>
 #include <signal.h>
 #include <stdio.h>
 #include <getty.h>
 #include <signal.h>
@@ -47,8 +48,8 @@ struct ttytype        *type();                /* find ttytype for port */
 FILE   *fopen();
 
 main (argc, argv)
 FILE   *fopen();
 
 main (argc, argv)
-int    argc;
-char   **argv;
+       int argc;
+       char **argv;
 {
        int             lineno;
        int             child;
 {
        int             lineno;
        int             child;
@@ -174,8 +175,8 @@ char        **argv;
                        quit(1);
                }
 
                        quit(1);
                }
 
-               fprintf(conf, conformat, "port", "active", "speed\t", "terminal name");
-               fprintf(conf, conformat, "----", "------", "-----\t", "-------------");
+               fprintf(conf, conformat, "port", "login", "speed\t", "terminal type");
+               fprintf(conf, conformat, "----", "-----", "-----\t", "-------------");
                for (ty = ttys; ty->ty_active; ty++)
                {
                        fprintf(conf, conformat, ty->ty_port,
                for (ty = ttys; ty->ty_active; ty++)
                {
                        fprintf(conf, conformat, ty->ty_port,
@@ -293,11 +294,11 @@ re_read:
        quit(0);
 }
 
        quit(0);
 }
 
+/*
+ * read ttys file
+ */
 readttys()
 {
 readttys()
 {
-       /*
-        * read ttys file
-        */
        FILE                    *tyf;
        register struct ttys    *ty;
        char                    buf[1024];
        FILE                    *tyf;
        register struct ttys    *ty;
        char                    buf[1024];
@@ -306,6 +307,8 @@ readttys()
 
        if ((tyf = fopen(etc_ttys, "r")) == NULL)
        {
 
        if ((tyf = fopen(etc_ttys, "r")) == NULL)
        {
+               if (exists(etc_conf))
+                       return (0);     /* hope user has it together! */
                perror(etc_ttys);
                quit(1);
        }
                perror(etc_ttys);
                quit(1);
        }
@@ -376,12 +379,11 @@ writettys()
        return (rtn);
 }
 
        return (rtn);
 }
 
-\f
+/*
+ * invoke editor
+ */
 edit()
 {
 edit()
 {
-       /*
-        * invoke editor
-        */
        int     child;
        int     status;
 
        int     child;
        int     status;
 
@@ -406,7 +408,6 @@ edit()
 
        return (status);
 }
 
        return (status);
 }
-\f
 
 quit (n)
 int    n;
 
 quit (n)
 int    n;
@@ -453,7 +454,7 @@ getlockfile ()
        unlink(locktmp);
        return(0);
 }
        unlink(locktmp);
        return(0);
 }
-\f
+
 struct speeds {
        char    *sp_name;       /* human readable name */
        char    sp_table;       /* getty table name */
 struct speeds {
        char    *sp_name;       /* human readable name */
        char    sp_table;       /* getty table name */
@@ -472,21 +473,21 @@ struct speeds {
        { "dw2console", GT_DW2CONSOLE },/* Decwriter Console - 300 baud */
        { "fastdialup", GT_FASTDIALUP },/* 1200-300 baud rotation for dialup */
        { "fastdialup1",GT_FASTDIALUP1},/* 300-1200  "     "       "     "    */
        { "dw2console", GT_DW2CONSOLE },/* Decwriter Console - 300 baud */
        { "fastdialup", GT_FASTDIALUP },/* 1200-300 baud rotation for dialup */
        { "fastdialup1",GT_FASTDIALUP1},/* 300-1200  "     "       "     "    */
-       { "crt_hcpy",   GT_CRT_HCPY },  /* 9600-300 CRT + hardcopy rotation */
-       { "hcpy_crt",   GT_HCPY_CRT },  /* 300-9600  "      "        "      */
+       { "crt",        GT_CRT_HCPY },  /* 9600-300 CRT + hardcopy rotation */
+       { "hardcopy",   GT_HCPY_CRT },  /* 300-9600  "      "        "      */
        { "plugboard",  GT_PLUGBOARD }, /* 9600-300-1200 rotation */
        { "plugboard1", GT_PLUGBOARD2 },/* 300-1200-9600 rotation */
        { "plugboard2", GT_PLUGBOARD2 },/* 1200-9600-300 rotation */
        { "interdata",  GT_INTERDATA }, /* Interdata Console */
        { "chess",      GT_CHESS },     /* LSI Chess Terminal */
        { "tty33",      GT_TTY33 },     /* 110 baud Model 33 TTY */
        { "plugboard",  GT_PLUGBOARD }, /* 9600-300-1200 rotation */
        { "plugboard1", GT_PLUGBOARD2 },/* 300-1200-9600 rotation */
        { "plugboard2", GT_PLUGBOARD2 },/* 1200-9600-300 rotation */
        { "interdata",  GT_INTERDATA }, /* Interdata Console */
        { "chess",      GT_CHESS },     /* LSI Chess Terminal */
        { "tty33",      GT_TTY33 },     /* 110 baud Model 33 TTY */
-       { "network",    GT_NETWORK },   /* ethernet port */
+       { "network",    GT_NETWORK },   /* network port */
        { "", 0 }
 };
 
 char *
 speedname (c)
        { "", 0 }
 };
 
 char *
 speedname (c)
-char   c;
+       char    c;
 {
        struct speeds   *sp;
        static char     sbuf[32];
 {
        struct speeds   *sp;
        static char     sbuf[32];
@@ -508,7 +509,7 @@ char        c;
 
 char *
 termname (port)
 
 char *
 termname (port)
-char   *port;
+       char    *port;
 {
        register struct ttytype *tp;
 
 {
        register struct ttytype *tp;
 
@@ -528,7 +529,7 @@ char        *port;
 
 char
 speedchar (speed)
 
 char
 speedchar (speed)
-char   *speed;
+       char    *speed;
 {
        register struct speeds  *sp;
 
 {
        register struct speeds  *sp;
 
@@ -540,7 +541,7 @@ char        *speed;
 
 struct ttytype *
 type (port)
 
 struct ttytype *
 type (port)
-char   *port;
+       char    *port;
 {
        register struct ttytype *tp;
 
 {
        register struct ttytype *tp;
 
@@ -557,22 +558,3 @@ char       *port;
 
        return((struct ttytype *)0);
 }
 
        return((struct ttytype *)0);
 }
-\f
-/* DELETE this for 4.2bsd */
-
-#include <errno.h>
-
-rename (from, to)
-char   *from, *to;
-{
-       extern int      errno;
-
-       if (unlink(to) < 0)
-               if (errno != ENOENT)
-                       return(-1);
-       if (link(from, to) == 0)
-               return (unlink(from));
-       else
-               return(-1);
-}
-