* Callback for when the script process finishes on POSIX systems.
*
* @param[in] pid Child pid.
- * @param[in] status Exit status of script.
+ * @param[in] exitcode Exit status of script.
* @param[in] _state Plugin state.
*
* @return FALSE.
static gboolean
PowerOpsScriptCallback(GPid pid,
- gint status,
+ gint exitcode,
gpointer _state)
{
PowerOpState *state = _state;
+ gboolean success = exitcode == 0;
ASSERT(state->pid != INVALID_PID);
- PowerOpsStateChangeDone(_state, status == 0);
+ g_debug("Script exit code: %d, success = %d\n", exitcode, success);
+ PowerOpsStateChangeDone(_state, success);
g_spawn_close_pid(state->pid);
state->pid = INVALID_PID;
return FALSE;
argv[0] = g_locale_from_utf8(script, -1, NULL, NULL, &err);
if (err != NULL) {
g_debug("Conversion error: %s\n", err->message);
+ g_clear_error(&err);
/*
* If we could not convert to current locate let's hope that
* what we have is a useable script name and use it directly.