}
result = ustcmd_send_cmd(cmd, pid, NULL);
- if (result) {
+ if (result != 1) {
free(cmd);
return USTCMD_ERR_GEN;
}
}
result = ustcmd_send_cmd(cmd, pid, &reply);
- if (result) {
+ if (result != 1) {
free(cmd);
- free(reply);
return -1;
}
}
result = ustcmd_send_cmd(cmd, pid, &reply);
- if (result) {
+ if (result != 1) {
free(cmd);
- free(reply);
return -1;
}
result = ustcmd_send_cmd(cmd, pid, &reply);
if (result != 1) {
free(cmd);
- free(reply);
return USTCMD_ERR_GEN;
}
* @param pid Targeted PID
* @param reply Pointer to string to be filled with a reply string (must
* be NULL if no reply is needed for the given command).
- * @return -1 if successful, 0 on EOT, 1 on success
+ * @return -1 if not successful, 0 on EOT, 1 on success
*/
int ustcmd_send_cmd(const char *cmd, const pid_t pid, char **reply)