Changeset dff5db9 in nscp for include/execute_process.hpp


Ignore:
Timestamp:
06/15/08 14:09:36 (5 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2, stable
Children:
e1ef872
Parents:
8f167e8
Message:

2008-06-14 MickeM

  • Fixed error message from external commands (better reporting now)

2008-05-14 MickeM

  • Fixed memoryleak in the service checker.

I am really sorry I usualy write better code then this.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/execute_process.hpp

    r5b9d247 rdff5db9  
    144144      CloseHandle(hChildOutR); 
    145145    } else { 
    146       msg = _T("NRPE_NT failed to create process (") + command + _T("): ") + error::lookup::last_error(); 
     146      DWORD error = GetLastError(); 
     147      if (error == ERROR_BAD_EXE_FORMAT) { 
     148        NSC_LOG_ERROR_STD(command + _T(" is not an .exe file or a valid image (if you run a script you usually need to prefix the command with the interpreter like so: \"command=c:\perl.exe <script>\"")); 
     149        msg = _T("ExternalCommands: failed to create process (") + command + _T("): it is not an exe file (check NSC.log for more info) - ") + error::lookup::last_error(error); 
     150      } else { 
     151        msg = _T("ExternalCommands: failed to create process (") + command + _T("): ") + error::lookup::last_error(error); 
     152      } 
    147153      result = NSCAPI::returnUNKNOWN; 
    148154      CloseHandle(hChildInR); 
Note: See TracChangeset for help on using the changeset viewer.