Ignore:
Timestamp:
Jan 4, 2008, 6:51:30 PM (16 years ago)
Author:
Bruno Cornec
Message:

before killing a process test that there is a result to ps (avoid whom to kill messages)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mondo/src/common/newt-specific.c

    r1747 r1850  
    350350
    351351char *tmp = NULL;
    352 
    353     asprintf(&tmp,"kill `ps %s | grep \" %s \" | awk '{print %s;}' | grep -v \"grep\"`", ps_options, str , ps_proc_id);
     352char *tmp1 = NULL;
     353
     354    asprintf(&tmp,"ps %s | grep \" %s \" | awk '{print %s;}' | grep -v \"grep\"", ps_options, str , ps_proc_id);
    354355    run_program_and_log_output(tmp, TRUE);
     356    if (strlen(tmp) > 0) {
     357        asprintf(&tmp1,"kill %s", tmp);
     358        run_program_and_log_output(tmp1, TRUE);
     359        paranoid_free(tmp1);
     360    }
    355361    paranoid_free(tmp);
    356362}
Note: See TracChangeset for help on using the changeset viewer.