plclient->exited = TRUE;
plclient->pid = -1;
/* Evaluate child exit status */
- pclient->exit_code = PROGRAM_CLIENT_EXIT_INTERNAL_FAILURE;
+ pclient->exit_status = PROGRAM_CLIENT_EXIT_STATUS_INTERNAL_FAILURE;
if (WIFEXITED(plclient->status)) {
/* Exited */
e_info(pclient->event,
"Terminated with non-zero exit code %d",
exit_code);
- pclient->exit_code = PROGRAM_CLIENT_EXIT_FAILURE;
+ pclient->exit_status =
+ PROGRAM_CLIENT_EXIT_STATUS_FAILURE;
} else {
- pclient->exit_code = PROGRAM_CLIENT_EXIT_SUCCESS;
+ pclient->exit_status =
+ PROGRAM_CLIENT_EXIT_STATUS_SUCCESS;
}
} else if (WIFSIGNALED(plclient->status)) {
/* Killed with a signal */
if (pid < 0) {
/* program never started */
e_debug(pclient->event, "Child process never started");
- pclient->exit_code = PROGRAM_CLIENT_EXIT_FAILURE;
+ pclient->exit_status = PROGRAM_CLIENT_EXIT_STATUS_FAILURE;
program_client_local_exited(plclient);
return;
}
bool other_error;
enum program_client_error error;
- enum program_client_exit_code exit_code;
+ enum program_client_exit_status exit_status;
int (*connect) (struct program_client * pclient);
int (*close_output) (struct program_client * pclient);
e_error(scstream->client->event,
"Missing LF in result code");
}
- scstream->client->exit_code =
- PROGRAM_CLIENT_EXIT_INTERNAL_FAILURE;
+ scstream->client->exit_status =
+ PROGRAM_CLIENT_EXIT_STATUS_INTERNAL_FAILURE;
return;
}
case '+':
e_debug(scstream->client->event,
"Received '+' result code from remote");
- scstream->client->exit_code = PROGRAM_CLIENT_EXIT_SUCCESS;
+ scstream->client->exit_status =
+ PROGRAM_CLIENT_EXIT_STATUS_SUCCESS;
break;
case '-':
e_debug(scstream->client->event,
"Received '-' result code from remote");
- scstream->client->exit_code = PROGRAM_CLIENT_EXIT_FAILURE;
+ scstream->client->exit_status =
+ PROGRAM_CLIENT_EXIT_STATUS_FAILURE;
break;
default:
if (rcode >= 0x20 && rcode < 0x7f) {
e_error(scstream->client->event,
"Unexpected result code 0x%02x", rcode);
}
- scstream->client->exit_code =
- PROGRAM_CLIENT_EXIT_INTERNAL_FAILURE;
+ scstream->client->exit_status =
+ PROGRAM_CLIENT_EXIT_STATUS_INTERNAL_FAILURE;
}
}
program_client_callback(pclient,
(pclient->error != PROGRAM_CLIENT_ERROR_NONE ?
- -1 : (int)pclient->exit_code),
+ -1 : (int)pclient->exit_status),
pclient->context);
}
if (pclient->error != PROGRAM_CLIENT_ERROR_NONE)
return -1;
- return (int)pclient->exit_code;
+ return (int)pclient->exit_status;
}
#undef program_client_run_async
i_assert(callback != NULL);
pclient->disconnected = FALSE;
- pclient->exit_code = PROGRAM_CLIENT_EXIT_SUCCESS;
+ pclient->exit_status = PROGRAM_CLIENT_EXIT_STATUS_SUCCESS;
pclient->error = PROGRAM_CLIENT_ERROR_NONE;
pclient->callback = callback;
struct program_client;
-enum program_client_exit_code {
- PROGRAM_CLIENT_EXIT_INTERNAL_FAILURE = -1,
- PROGRAM_CLIENT_EXIT_FAILURE = 0,
- PROGRAM_CLIENT_EXIT_SUCCESS = 1,
+enum program_client_exit_status {
+ PROGRAM_CLIENT_EXIT_STATUS_INTERNAL_FAILURE = -1,
+ PROGRAM_CLIENT_EXIT_STATUS_FAILURE = 0,
+ PROGRAM_CLIENT_EXIT_STATUS_SUCCESS = 1,
};
struct program_client_settings {