if (ret < 0)
goto out;
fd = ret;
- ret = send_bin_buffer(fd, buf, sizeof(buf));
+ ret = write_all(fd, buf, sizeof(buf));
if (ret < 0)
goto out;
/*
no_admissible_files:
*(uint32_t *)buf = NO_ADMISSIBLE_FILES;
*(uint32_t *)(buf + 4) = (uint32_t)0;
- return send_bin_buffer(server_socket, buf, 8);
+ return write_all(server_socket, buf, 8);
}
/* Never fails if arg == NULL */
int sc_send_result(struct osl_object *result, void *private)
{
struct stream_cipher_context *scc = private;
+ int ret;
if (!result->size)
return 1;
- return sc_send_bin_buffer(scc, result->data, result->size);
+ ret = sc_send_bin_buffer(scc, result->data, result->size);
+ if (ret < 0 || ret == result->size)
+ return ret;
+ return -E_SHORT_WRITE;
}
int com_select(struct stream_cipher_context *scc, int argc, char * const * const argv)
ret = shm_detach(shm);
if (ret < 0)
goto err;
- ret = send_bin_buffer(fd, (char *)&shmid, sizeof(int));
+ ret = write_all(fd, (char *)&shmid, sizeof(int));
if (ret >= 0)
return ret;
err: