Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/coreutils/logname.c

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

revision 816 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 25  Line 25 
25  /* This is a NOFORK applet. Be very careful! */  /* This is a NOFORK applet. Be very careful! */
26    
27  int logname_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;  int logname_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
28  int logname_main(int argc, char **argv UNUSED_PARAM)  int logname_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
29  {  {
30   char buf[128];   char buf[64];
31    
32   if (argc > 1) {   if (argv[1]) {
33   bb_show_usage();   bb_show_usage();
34   }   }
35    
36   /* Using _r function - avoid pulling in static buffer from libc */   /* Using _r function - avoid pulling in static buffer from libc */
37   if (getlogin_r(buf, sizeof(buf)) == 0) {   if (getlogin_r(buf, sizeof(buf)) == 0) {
38   puts(buf);   puts(buf);
39   return fflush(stdout);   return fflush_all();
40   }   }
41    
42   bb_perror_msg_and_die("getlogin");   bb_perror_msg_and_die("getlogin");

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