]> granicus.if.org Git - procps-ng/commitdiff
Merge commit 'refs/merge-requests/2' of git://gitorious.org/procps/procps into merge...
authorCraig Small <csmall@enc.com.au>
Wed, 11 Sep 2013 10:50:48 +0000 (20:50 +1000)
committerCraig Small <csmall@enc.com.au>
Wed, 11 Sep 2013 10:50:48 +0000 (20:50 +1000)
Conflicts:
uptime.c

1  2 
proc/whattime.c
top/top.c
uptime.1
uptime.c
w.c

diff --cc proc/whattime.c
Simple merge
diff --cc top/top.c
index 9996fbf8c60420a7db619d42cb26fc74fda40fab,73aa2827738cb7a7027074ccdf7a72dcfd126859..6f4f7288eaf9696429780939376e8826c7e433be
+++ b/top/top.c
@@@ -4997,12 -3388,12 +4997,12 @@@ static void summary_show (void) 
     // Display Uptime and Loadavg
     if (isROOM(View_LOADAV, 1)) {
        if (!Rc.mode_altscr)
-          show_special(0, fmtmk(LOADAV_line, Myname, sprint_uptime()));
+          show_special(0, fmtmk(LOADAV_line, Myname, sprint_uptime(0)));
        else
           show_special(0, fmtmk(CHKw(w, Show_TASKON)? LOADAV_line_alt : LOADAV_line
-             , w->grpname, sprint_uptime()));
+             , w->grpname, sprint_uptime(0)));
        Msg_row += 1;
 -   }
 +   } // end: View_LOADAV
  
     // Display Task and Cpu(s) States
     if (isROOM(View_STATES, 2)) {
diff --cc uptime.1
Simple merge
diff --cc uptime.c
index 27421895ff90d20608eaafdf169f382a6c93f610,557b08ced132866b16bbf688ede9142a189d8234..91275ca8b9e4e2a120c1e55f45dd9d1c3f653919
+++ b/uptime.c
@@@ -58,8 -13,8 +58,9 @@@ static void __attribute__ ((__noreturn_
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options]\n"), program_invocation_short_name);
        fputs(USAGE_OPTIONS, out);
+       fputs(_(" -p, --pretty   show uptime in pretty format\n"), out);
        fputs(USAGE_HELP, out);
 +      fputs(_(" -s, --since    system up since\n"), out);
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("uptime(1)"));
  
  
  int main(int argc, char **argv)
  {
-       int c;
+       int c, p = 0;
  
        static const struct option longopts[] = {
+               {"pretty", no_argument, NULL, 'p'},
                {"help", no_argument, NULL, 'h'},
 +              {"since", no_argument, NULL, 's'},
                {"version", no_argument, NULL, 'V'},
                {NULL, 0, NULL, 0}
        };
        setlocale (LC_ALL, "");
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
 +      atexit(close_stdout);
  
-       while ((c = getopt_long(argc, argv, "hsV", longopts, NULL)) != -1)
 -      while ((c = getopt_long(argc, argv, "phV", longopts, NULL)) != -1)
++      while ((c = getopt_long(argc, argv, "phsV", longopts, NULL)) != -1)
                switch (c) {
+               case 'p':
+                       p = 1;
+                       break;
                case 'h':
                        usage(stdout);
 +              case 's':
 +                      print_uptime_since();
 +                      return EXIT_SUCCESS;
                case 'V':
                        printf(PROCPS_NG_VERSION);
                        return EXIT_SUCCESS;
diff --cc w.c
Simple merge