Ignore:
Timestamp:
Nov 13, 2006, 10:17:07 AM (17 years ago)
Author:
Bruno Cornec
Message:

ps (busybox) and ps (system) do not give PID in the same column. Adapted with a global variable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-fifo.c

    r797 r928  
    137137
    138138extern char *ps_options;
     139extern char *ps_proc_id;
    139140
    140141/**
     
    233234/**
    234235 * Kill @c buffer processes.
     236 * Only called in mondoarchive
    235237 */
    236238void kill_buffer()
     
    243245    paranoid_system("sync");
    244246    sprintf(command,
    245             "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $1;}' | grep -v PID | tr -s '\n' ' ' | awk '{ print $1; }'", ps_options,
     247            "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options,
    246248            g_sz_call_to_buffer);
    247249    log_msg(2, "kill_buffer() --- command = %s", command);
Note: See TracChangeset for help on using the changeset viewer.