struct cmd_text_pdu *pdu = (struct cmd_text_pdu *) cmdret->payload;
char *buf = (char *) pdu->buf;
- buf[pdu->buf_len ] = '\0';
+ buf[pdu->buf_len] = '\0';
} else if (cmdret->opcode == FIO_NET_CMD_JOB) {
struct cmd_job_pdu *pdu = (struct cmd_job_pdu *) cmdret->payload;
char *buf = (char *) pdu->buf;
{
dprint(FD_NET, "server: sending quit\n");
- return fio_net_send_simple_cmd(server_fd, FIO_NET_CMD_QUIT, 0, NULL);
+ return fio_net_send_simple_cmd(sk, FIO_NET_CMD_QUIT, 0, NULL);
}
int fio_net_send_stop(int sk, int error, int signal)
epdu.error = __cpu_to_le32(error);
epdu.signal = __cpu_to_le32(signal);
- return fio_net_send_cmd(server_fd, FIO_NET_CMD_STOP, &epdu, sizeof(epdu), 0);
+ return fio_net_send_cmd(sk, FIO_NET_CMD_STOP, &epdu, sizeof(epdu), 0);
}
static void fio_server_add_fork_item(pid_t pid, struct flist_head *list)
free(ffi);
}
-static void fio_server_check_fork_items(struct flist_head *list, int bla)
+static void fio_server_check_fork_items(struct flist_head *list)
{
struct flist_head *entry, *tmp;
struct fio_fork_item *ffi;
static void fio_server_check_jobs(void)
{
- fio_server_check_fork_items(&job_list, 0);
+ fio_server_check_fork_items(&job_list);
}
static void fio_server_check_conns(void)
{
- fio_server_check_fork_items(&conn_list, 1);
+ fio_server_check_fork_items(&conn_list);
}
static int handle_run_cmd(struct fio_net_cmd *cmd)
ret = handle_run_cmd(cmd);
break;
default:
- log_err("fio: unknown opcode: %s\n",fio_server_op(cmd->opcode));
+ log_err("fio: unknown opcode: %s\n", fio_server_op(cmd->opcode));
ret = 1;
}
ret = 0;
do {
- ret = poll(&pfd, 1, 100);
+ int timeout = 1000;
+
+ if (!flist_empty(&job_list))
+ timeout = 100;
+
+ ret = poll(&pfd, 1, timeout);
if (ret < 0) {
if (errno == EINTR)
break;
pfd.fd = listen_sk;
pfd.events = POLLIN;
do {
- ret = poll(&pfd, 1, 100);
+ int timeout = 1000;
+
+ if (!flist_empty(&conn_list))
+ timeout = 100;
+
+ ret = poll(&pfd, 1, timeout);
if (ret < 0) {
if (errno == EINTR)
break;
cmd.flags = __cpu_to_le32(flags);
fio_net_cmd_crc_pdu(&cmd, buf);
- return fio_sendv_data(server_fd, iov, 2);
+ return fio_sendv_data(sk, iov, 2);
}
int fio_send_iolog(struct thread_data *td, struct io_log *log, const char *name)
#if defined(WIN32)
WSADATA wsd;
- WSAStartup(MAKEWORD(2,2), &wsd);
+ WSAStartup(MAKEWORD(2, 2), &wsd);
#endif
if (!pidfile)