/[hurd]/hurd/daemons/getty.c
ViewVC logotype

Diff of /hurd/daemons/getty.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15 by tb, Tue Sep 28 14:17:25 1999 UTC revision 1.16 by marcus, Sun Sep 15 16:31:17 2002 UTC
# Line 31  Line 31 
31  #include <string.h>  #include <string.h>
32  #include <utmp.h>  #include <utmp.h>
33  #include <sys/ioctl.h>  #include <sys/ioctl.h>
34    #include <termios.h>
35    
36  /* XXX */  /* XXX */
37  extern char *localhost ();  extern char *localhost ();
38    
39  #define _PATH_LOGIN "/bin/login"  #define _PATH_LOGIN "/bin/login"
40    
41    /* Parse the terminal speed.  */
42    static void
43    set_speed (int tty, char *speedstr)
44    {
45      error_t err;
46      struct termios ttystat;
47      speed_t speed;
48      char *tail;
49    
50      errno = 0;
51      speed = strtoul (speedstr, &tail, 0);
52      if (errno || *tail)
53        return;
54    
55      err = tcgetattr (tty, &ttystat);
56      if (!err && !cfsetspeed (&ttystat, speed))
57        tcsetattr (tty, TCSAFLUSH, &ttystat);
58    }
59    
60    
61  /* Print a suitable welcome banner */  /* Print a suitable welcome banner */
62  static void  static void
63  print_banner (int fd, char *ttyname)  print_banner (int fd, char *ttyname)
# Line 73  main (int argc, char **argv) Line 94  main (int argc, char **argv)
94      }      }
95    
96    /* Don't do anything with this for now. */    /* Don't do anything with this for now. */
97    linespec = argv[2];    linespec = argv[1];
98    
99    tt = getttynam (argv[2]);    tt = getttynam (argv[2]);
100    asprintf (&ttyname, "%s/%s", _PATH_DEV, argv[2]);    asprintf (&ttyname, "%s/%s", _PATH_DEV, argv[2]);
# Line 95  main (int argc, char **argv) Line 116  main (int argc, char **argv)
116      }      }
117    while (tty == -1);    while (tty == -1);
118    
119      set_speed (tty, linespec);
120    
121    print_banner (tty, ttyname);    print_banner (tty, ttyname);
122    
123    if (login_tty (tty) == -1)    if (login_tty (tty) == -1)

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26