]> granicus.if.org Git - procps-ng/commitdiff
pgrep: remove commented old code
authorCraig Small <csmall@enc.com.au>
Sat, 26 Sep 2015 04:34:51 +0000 (14:34 +1000)
committerCraig Small <csmall@enc.com.au>
Sat, 26 Sep 2015 04:34:51 +0000 (14:34 +1000)
pgrep had old API code commented out, its now removed.

pgrep.c

diff --git a/pgrep.c b/pgrep.c
index 68485f4e35f22aff165d1c42e3ff0154c89417bc..b5b011a44fc4896027cc4991e01c8174a63e69a6 100644 (file)
--- a/pgrep.c
+++ b/pgrep.c
@@ -538,28 +538,8 @@ static struct el * select_procs (int *num)
             match = 0;
         else if (opt_term)
             match = match_strlist(PIDS_GETSTR(TTY_NAME), opt_term);
-        
-        task_cmdline = PIDS_GETSTR(CMDLINE);
-#if 0 // FIXME cmdline stuff
-        if (pid_cmdline && (opt_longlong || opt_full) ) {
-            int i = 0;
-            int bytes = sizeof (cmdline) - 1;
-
-            /* make sure it is always NUL-terminated */
-            cmdline[bytes] = 0;
-            /* make room for SPC in loop below */
-            --bytes;
-
-            strncpy (cmdline, pid_cmdline[i], bytes);
-            bytes -= strlen (task.cmdline[i++]);
-            while (task.cmdline[i] && bytes > 0) {
-                strncat (cmdline, " ", bytes);
-                strncat (cmdline, task.cmdline[i], bytes);
-                bytes -= strlen (task.cmdline[i++]) + 1;
-            }
-        }
-#endif
 
+        task_cmdline = PIDS_GETSTR(CMDLINE);
         if (opt_long || opt_longlong || (match && opt_pattern)) {
             if (opt_longlong && task_cmdline)
                 strncpy (cmdoutput, task_cmdline, CMDSTRSIZE);
@@ -606,38 +586,6 @@ static struct el * select_procs (int *num)
             } else {
                 xerrx(EXIT_FATAL, _("internal error"));
             }
-#if 0
-            // pkill does not need subtasks!
-            // this control is still done at
-            // argparse time, but a further
-            // control is free
-            if (opt_threads && !i_am_pkill) {
-                proc_t subtask;
-                memset(&subtask, 0, sizeof (subtask));
-                while (readtask(ptp, &task, &subtask)){
-                    // don't add redundand tasks
-                    if (task.XXXID == subtask.XXXID)
-                        continue;
-
-                    // eventually grow output buffer
-                    if (matches == size) {
-                        size = size * 5 / 4 + 4;
-                        list = realloc(list, size * sizeof *list);
-                        if (list == NULL)
-                            exit (EXIT_FATAL);
-                    }
-                    if (opt_long || opt_longlong) {
-                        list[matches].str = xstrdup (cmdoutput);
-                        list[matches++].num = subtask.XXXID;
-                    } else {
-                        list[matches++].num = subtask.XXXID;
-                    }
-                    memset(&subtask, 0, sizeof (subtask));
-                }
-            }
-
-#endif
-
         }
     }