[BACK]Return to top.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / top

Diff for /src/usr.bin/top/top.c between version 1.44 and 1.45

version 1.44, 2006/12/27 07:24:52 version 1.45, 2007/01/03 18:57:49
Line 128 
Line 128 
 #define CMD_pid         17  #define CMD_pid         17
 #define CMD_command     18  #define CMD_command     18
 #define CMD_threads     19  #define CMD_threads     19
   #define CMD_grep        20
   
 static void  static void
 usage(void)  usage(void)
Line 135 
Line 136 
         extern char *__progname;          extern char *__progname;
   
         fprintf(stderr,          fprintf(stderr,
             "usage: %s [-bCIinqSTu] [-d count] [-o field] [-p pid] [-s time] [-U username] [number]\n",              "usage: %s [-bCIinqSTu] [-d count] [-g command] [-o field] [-p pid] [-s time]\n\t[-U username] [number]\n",
             __progname);              __progname);
 }  }
   
Line 145 
Line 146 
         char *endp;          char *endp;
         int i;          int i;
   
         while ((i = getopt(ac, av, "STICbinqus:d:p:U:o:")) != -1) {          while ((i = getopt(ac, av, "STICbinqus:d:p:U:o:g:")) != -1) {
                 switch (i) {                  switch (i) {
                 case 'C':                  case 'C':
                         show_args = Yes;                          show_args = Yes;
Line 236 
Line 237 
                         order_name = optarg;                          order_name = optarg;
                         break;                          break;
   
                   case 'g':       /* grep command name */
                           ps.command = strdup(optarg);
                           break;
   
                 default:                  default:
                         usage();                          usage();
                         exit(1);                          exit(1);
Line 522 
Line 527 
         int change, i;          int change, i;
         struct pollfd pfd[1];          struct pollfd pfd[1];
         uid_t uid;          uid_t uid;
         static char command_chars[] = "\f qh?en#sdkriIuSopCT";          static char command_chars[] = "\f qh?en#sdkriIuSopCTg";
   
         /*          /*
          * assume valid command unless told           * assume valid command unless told
Line 866 
Line 871 
                         new_message(MT_standout | MT_delayed,                          new_message(MT_standout | MT_delayed,
                             " %sisplaying threads.",                              " %sisplaying threads.",
                             ps.threads ? "D" : "Not d");                              ps.threads ? "D" : "Not d");
                           break;
   
                   case CMD_grep:
                           new_message(MT_standout,
                               "Grep command name: ");
                           if (readline(tempbuf2, sizeof(tempbuf2), No) > 0) {
                                   free(ps.command);
                                   if (tempbuf2[0] == '+' &&
                                       tempbuf2[1] == '\0')
                                           ps.command = NULL;
                                   else
                                           ps.command = strdup(tempbuf2);
                                   if (putchar('\r') == EOF)
                                           exit(1);
                           } else
                                   clear_message();
                         break;                          break;
   
                 default:                  default:

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45