Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/init/mesg.c

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

revision 983 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 16  Line 16 
16  #endif  #endif
17    
18  int mesg_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;  int mesg_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
19  int mesg_main(int argc, char **argv)  int mesg_main(int argc UNUSED_PARAM, char **argv)
20  {  {
21   struct stat sb;   struct stat sb;
22   const char *tty;   const char *tty;
23   char c = 0;   char c = 0;
24    
25   if (--argc == 0   argv++;
26   || (argc == 1 && ((c = **++argv) == 'y' || c == 'n'))  
27     if (!argv[0]
28     || (!argv[1] && ((c = argv[0][0]) == 'y' || c == 'n'))
29   ) {   ) {
30   tty = ttyname(STDERR_FILENO);   tty = xmalloc_ttyname(STDERR_FILENO);
31   if (tty == NULL) {   if (tty == NULL) {
32   tty = "ttyname";   tty = "ttyname";
33   } else if (stat(tty, &sb) == 0) {   } else if (stat(tty, &sb) == 0) {
34   mode_t m;   mode_t m;
35   if (argc == 0) {   if (c == 0) {
36   puts((sb.st_mode & (S_IWGRP|S_IWOTH)) ? "is y" : "is n");   puts((sb.st_mode & (S_IWGRP|S_IWOTH)) ? "is y" : "is n");
37   return EXIT_SUCCESS;   return EXIT_SUCCESS;
38   }   }

Legend:
Removed from v.983  
changed lines
  Added in v.984