Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/console-tools/setlogcons.c

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

revision 815 by niro, Sat Sep 1 22:45:15 2007 UTC revision 816 by niro, Fri Apr 24 18:33:46 2009 UTC
# Line 9  Line 9 
9   * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.   * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
10   */   */
11    
12  #include "busybox.h"  #include "libbb.h"
13    
14  extern int setlogcons_main(int argc, char **argv)  int setlogcons_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
15    int setlogcons_main(int argc UNUSED_PARAM, char **argv)
16  {  {
17   struct {   struct {
18   char fn;   char fn;
19   char subarg;   char subarg;
20   } arg;   } arg = { 11, /* redirect kernel messages */
21      0   /* to specified console (current as default) */
22     };
23    
24   arg.fn = 11;    /* redirect kernel messages */   if (argv[1])
25   arg.subarg = 0; /* to specified console (current as default) */   arg.subarg = xatou_range(argv[1], 0, 63);
26    
27   if (argc == 2)   xioctl(xopen(VC_1, O_RDONLY), TIOCLINUX, &arg);
  arg.subarg = xatoul_range(argv[1], 0, 63);  
28    
29   if (ioctl(xopen(VC_1, O_RDONLY), TIOCLINUX, &arg))   return EXIT_SUCCESS;
  bb_perror_msg_and_die("TIOCLINUX");  
   
  return 0;  
30  }  }

Legend:
Removed from v.815  
changed lines
  Added in v.816