qrexec: fix compile warnings
This commit is contained in:
parent
6efbbb88da
commit
1d017449d0
@ -155,7 +155,7 @@ static int connect_unix_socket(const char *domname)
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sigchld_handler(int x)
|
static void sigchld_handler(int x __attribute__((__unused__)))
|
||||||
{
|
{
|
||||||
child_exited = 1;
|
child_exited = 1;
|
||||||
signal(SIGCHLD, sigchld_handler);
|
signal(SIGCHLD, sigchld_handler);
|
||||||
@ -192,7 +192,7 @@ static void prepare_local_fds(char *cmdline)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ask the daemon to allocate vchan port */
|
/* ask the daemon to allocate vchan port */
|
||||||
static void negotiate_connection_params(int s, int other_domid, int type,
|
static void negotiate_connection_params(int s, int other_domid, unsigned type,
|
||||||
void *cmdline_param, int cmdline_size,
|
void *cmdline_param, int cmdline_size,
|
||||||
int *data_domain, int *data_port)
|
int *data_domain, int *data_port)
|
||||||
{
|
{
|
||||||
@ -255,11 +255,11 @@ static void send_exit_code(libvchan_t *vchan, int status)
|
|||||||
|
|
||||||
hdr.type = MSG_DATA_EXIT_CODE;
|
hdr.type = MSG_DATA_EXIT_CODE;
|
||||||
hdr.len = sizeof(int);
|
hdr.len = sizeof(int);
|
||||||
if (libvchan_send(vchan, &hdr, sizeof(hdr)) < sizeof(hdr)) {
|
if (libvchan_send(vchan, &hdr, sizeof(hdr)) != sizeof(hdr)) {
|
||||||
fprintf(stderr, "Failed to write exit code to the agent\n");
|
fprintf(stderr, "Failed to write exit code to the agent\n");
|
||||||
do_exit(1);
|
do_exit(1);
|
||||||
}
|
}
|
||||||
if (libvchan_send(vchan, &status, sizeof(status)) < sizeof(status)) {
|
if (libvchan_send(vchan, &status, sizeof(status)) != sizeof(status)) {
|
||||||
fprintf(stderr, "Failed to write exit code(2) to the agent\n");
|
fprintf(stderr, "Failed to write exit code(2) to the agent\n");
|
||||||
do_exit(1);
|
do_exit(1);
|
||||||
}
|
}
|
||||||
@ -278,7 +278,7 @@ static void handle_input(libvchan_t *vchan)
|
|||||||
}
|
}
|
||||||
hdr.type = is_service ? MSG_DATA_STDOUT : MSG_DATA_STDIN;
|
hdr.type = is_service ? MSG_DATA_STDOUT : MSG_DATA_STDIN;
|
||||||
hdr.len = ret;
|
hdr.len = ret;
|
||||||
if (libvchan_send(vchan, &hdr, sizeof(hdr)) < sizeof(hdr)) {
|
if (libvchan_send(vchan, &hdr, sizeof(hdr)) != sizeof(hdr)) {
|
||||||
fprintf(stderr, "Failed to write STDIN data to the agent\n");
|
fprintf(stderr, "Failed to write STDIN data to the agent\n");
|
||||||
do_exit(1);
|
do_exit(1);
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ int handle_agent_hello(libvchan_t *ctrl, const char *domain_name)
|
|||||||
struct msg_header hdr;
|
struct msg_header hdr;
|
||||||
struct peer_info info;
|
struct peer_info info;
|
||||||
|
|
||||||
if (libvchan_recv(ctrl, &hdr, sizeof(hdr)) < sizeof(hdr)) {
|
if (libvchan_recv(ctrl, &hdr, sizeof(hdr)) != sizeof(hdr)) {
|
||||||
fprintf(stderr, "Failed to read agent HELLO hdr\n");
|
fprintf(stderr, "Failed to read agent HELLO hdr\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -191,7 +191,7 @@ int handle_agent_hello(libvchan_t *ctrl, const char *domain_name)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (libvchan_recv(ctrl, &info, sizeof(info)) < sizeof(info)) {
|
if (libvchan_recv(ctrl, &info, sizeof(info)) != sizeof(info)) {
|
||||||
fprintf(stderr, "Failed to read agent HELLO body\n");
|
fprintf(stderr, "Failed to read agent HELLO body\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -209,12 +209,12 @@ int handle_agent_hello(libvchan_t *ctrl, const char *domain_name)
|
|||||||
hdr.len = sizeof(info);
|
hdr.len = sizeof(info);
|
||||||
info.version = QREXEC_PROTOCOL_VERSION;
|
info.version = QREXEC_PROTOCOL_VERSION;
|
||||||
|
|
||||||
if (libvchan_send(ctrl, &hdr, sizeof(hdr)) < sizeof(hdr)) {
|
if (libvchan_send(ctrl, &hdr, sizeof(hdr)) != sizeof(hdr)) {
|
||||||
fprintf(stderr, "Failed to send HELLO hdr to agent\n");
|
fprintf(stderr, "Failed to send HELLO hdr to agent\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (libvchan_send(ctrl, &info, sizeof(info)) < sizeof(info)) {
|
if (libvchan_send(ctrl, &info, sizeof(info)) != sizeof(info)) {
|
||||||
fprintf(stderr, "Failed to send HELLO hdr to agent\n");
|
fprintf(stderr, "Failed to send HELLO hdr to agent\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -554,12 +554,12 @@ static void send_service_refused(libvchan_t *vchan, struct service_params *param
|
|||||||
hdr.type = MSG_SERVICE_REFUSED;
|
hdr.type = MSG_SERVICE_REFUSED;
|
||||||
hdr.len = sizeof(*params);
|
hdr.len = sizeof(*params);
|
||||||
|
|
||||||
if (libvchan_send(vchan, &hdr, sizeof(hdr)) < sizeof(hdr)) {
|
if (libvchan_send(vchan, &hdr, sizeof(hdr)) != sizeof(hdr)) {
|
||||||
fprintf(stderr, "Failed to send MSG_SERVICE_REFUSED hdr to agent\n");
|
fprintf(stderr, "Failed to send MSG_SERVICE_REFUSED hdr to agent\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (libvchan_send(vchan, params, sizeof(*params)) < sizeof(*params)) {
|
if (libvchan_send(vchan, params, sizeof(*params)) != sizeof(*params)) {
|
||||||
fprintf(stderr, "Failed to send MSG_SERVICE_REFUSED to agent\n");
|
fprintf(stderr, "Failed to send MSG_SERVICE_REFUSED to agent\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -809,7 +809,7 @@ int main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
for (;;) {
|
for (;;) {
|
||||||
max = fill_fdsets_for_select(&read_fdset, &write_fdset);
|
max = fill_fdsets_for_select(&read_fdset, &write_fdset);
|
||||||
if (libvchan_buffer_space(vchan) <= sizeof(struct msg_header))
|
if (libvchan_buffer_space(vchan) <= (int)sizeof(struct msg_header))
|
||||||
FD_ZERO(&read_fdset); // vchan full - don't read from clients
|
FD_ZERO(&read_fdset); // vchan full - don't read from clients
|
||||||
|
|
||||||
sigprocmask(SIG_BLOCK, &chld_set, NULL);
|
sigprocmask(SIG_BLOCK, &chld_set, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user