From 492a2c64db498402142590a4e0130dde89ca58bf Mon Sep 17 00:00:00 2001 From: Craig Small Date: Sat, 26 Sep 2015 14:34:51 +1000 Subject: [PATCH] pgrep: remove commented old code pgrep had old API code commented out, its now removed. --- pgrep.c | 54 +----------------------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/pgrep.c b/pgrep.c index 68485f4e..b5b011a4 100644 --- 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 - } } -- 2.40.0