Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/procps/free.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    
10  /* getopt not needed */  /* getopt not needed */
11    
12  #include "busybox.h"  #include "libbb.h"
13    
14    int free_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
15  int free_main(int argc, char **argv)  int free_main(int argc, char **argv)
16  {  {
17   struct sysinfo info;   struct sysinfo info;
18   sysinfo(&info);   sysinfo(&info);
19    
20   /* Kernels prior to 2.4.x will return info.mem_unit==0, so cope... */   /* Kernels prior to 2.4.x will return info.mem_unit==0, so cope... */
21   if (info.mem_unit==0) {   if (info.mem_unit == 0) {
22   info.mem_unit=1;   info.mem_unit=1;
23   }   }
24   if ( info.mem_unit == 1 ) {   if (info.mem_unit == 1) {
25   info.mem_unit=1024;   info.mem_unit=1024;
26    
27   /* TODO:  Make all this stuff not overflow when mem >= 4 Gib */   /* TODO:  Make all this stuff not overflow when mem >= 4 Gib */
# Line 45  int free_main(int argc, char **argv) Line 46  int free_main(int argc, char **argv)
46   info.bufferram*=info.mem_unit;   info.bufferram*=info.mem_unit;
47   }   }
48    
49   if (argc > 1 && **(argv + 1) == '-')   if (argc > 1 && *argv[1] == '-')
50   bb_show_usage();   bb_show_usage();
51    
52   printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free",   printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free",
# Line 65  int free_main(int argc, char **argv) Line 66  int free_main(int argc, char **argv)
66  #endif  #endif
67   return EXIT_SUCCESS;   return EXIT_SUCCESS;
68  }  }
   

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