~vorlon/ubuntu/raring/upstart/lp.1199778

« back to all changes in this revision

Viewing changes to init/process.c

  • Committer: Scott James Remnant
  • Date: 2006-08-31 19:49:43 UTC
  • Revision ID: scott@netsplit.com-20060831194943-d6c81a469f92f557
* init/process.c (process_setup_console): Remove the console reset
code, it tends to just crash X and seems to do nothing interesting.
* init/main.c (reset_console): Instead put it here and just do it
on startup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include <stdlib.h>
38
38
#include <string.h>
39
39
#include <unistd.h>
40
 
#include <termios.h>
41
40
 
42
41
#include <nih/macros.h>
43
42
#include <nih/alloc.h>
304
303
                        if (type == CONSOLE_OWNER)
305
304
                                ioctl (fd, TIOCSCTTY, 1);
306
305
 
307
 
                        /* Set up the console flags to something sensible
308
 
                         * (cribbed from sysvinit)
309
 
                         */
310
 
                        tcgetattr (fd, &tty);
311
 
 
312
 
                        tty.c_cflag &= (CBAUD | CBAUDEX | CSIZE | CSTOPB
313
 
                                        | PARENB | PARODD);
314
 
                        tty.c_cflag |= (HUPCL | CLOCAL | CREAD);
315
 
 
316
 
                        /* Set up usual keys */
317
 
                        tty.c_cc[VINTR]  = 3;   /* ^C */
318
 
                        tty.c_cc[VQUIT]  = 28;  /* ^\ */
319
 
                        tty.c_cc[VERASE] = 127;
320
 
                        tty.c_cc[VKILL]  = 24;  /* ^X */
321
 
                        tty.c_cc[VEOF]   = 4;   /* ^D */
322
 
                        tty.c_cc[VTIME]  = 0;
323
 
                        tty.c_cc[VMIN]   = 1;
324
 
                        tty.c_cc[VSTART] = 17;  /* ^Q */
325
 
                        tty.c_cc[VSTOP]  = 19;  /* ^S */
326
 
                        tty.c_cc[VSUSP]  = 26;  /* ^Z */
327
 
 
328
 
                        /* Pre and post processing */
329
 
                        tty.c_iflag = (IGNPAR | ICRNL | IXON | IXANY);
330
 
                        tty.c_oflag = (OPOST | ONLCR);
331
 
                        tty.c_lflag = (ISIG | ICANON | ECHO | ECHOCTL
332
 
                                       | ECHOPRT | ECHOKE);
333
 
 
334
 
                        /* Set the terminal line */
335
 
                        tcsetattr (fd, TCSANOW, &tty);
336
 
                        tcflush (fd, TCIOFLUSH);
337
306
                        break;
338
307
                }
339
308
 
355
324
 
356
325
        return 0;
357
326
}
358