Lines Matching refs:cmd
637 union cmd { union
638 int cmd; member
642 int cmd; member
649 int cmd; member
656 int cmd; member
672 static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out) in cmd_session_list() argument
674 char csv_sep = cmd->list.csv_sep; in cmd_session_list()
698 if (cmd->list.verbose) { in cmd_session_list()
738 if (!cmd->list.verbose) in cmd_session_list()
763 static int cmd_session_kill(struct daemon *daemon, union cmd *cmd, FILE *out) in cmd_session_kill() argument
768 all = !strcmp(cmd->signal.name, "all"); in cmd_session_kill()
771 if (all || !strcmp(cmd->signal.name, session->name)) { in cmd_session_kill()
772 daemon_session__signal(session, cmd->signal.sig); in cmd_session_kill()
774 cmd->signal.sig, session->name, session->pid); in cmd_session_kill()
786 static int cmd_session_ping(struct daemon *daemon, union cmd *cmd, FILE *out) in cmd_session_ping() argument
791 all = !strcmp(cmd->ping.name, "all"); in cmd_session_ping()
794 if (all || !strcmp(cmd->ping.name, session->name)) { in cmd_session_ping()
804 ping_str[PING_FAIL], cmd->ping.name); in cmd_session_ping()
813 union cmd cmd; in handle_server_socket() local
821 if (sizeof(cmd) != readn(fd, &cmd, sizeof(cmd))) { in handle_server_socket()
832 switch (cmd.cmd) { in handle_server_socket()
834 ret = cmd_session_list(daemon, &cmd, out); in handle_server_socket()
837 ret = cmd_session_kill(daemon, &cmd, out); in handle_server_socket()
845 ret = cmd_session_ping(daemon, &cmd, out); in handle_server_socket()
1124 static int lockf(int fd, int cmd, off_t len) in lockf() argument
1126 if (cmd != F_TLOCK || len != 0) in lockf()
1359 static int send_cmd(struct daemon *daemon, union cmd *cmd) in send_cmd() argument
1374 if (sizeof(*cmd) != writen(fd, cmd, sizeof(*cmd))) { in send_cmd()
1404 union cmd cmd; in send_cmd_list() local
1406 memset(&cmd, 0, sizeof(cmd)); in send_cmd_list()
1407 cmd.list.cmd = CMD_LIST; in send_cmd_list()
1408 cmd.list.verbose = verbose; in send_cmd_list()
1409 cmd.list.csv_sep = daemon->csv_sep ? *daemon->csv_sep : 0; in send_cmd_list()
1411 return send_cmd(daemon, &cmd); in send_cmd_list()
1424 union cmd cmd; in __cmd_signal() local
1435 memset(&cmd, 0, sizeof(cmd)); in __cmd_signal()
1436 cmd.signal.cmd = CMD_SIGNAL, in __cmd_signal()
1437 cmd.signal.sig = SIGUSR2; in __cmd_signal()
1438 strncpy(cmd.signal.name, name, sizeof(cmd.signal.name) - 1); in __cmd_signal()
1440 return send_cmd(daemon, &cmd); in __cmd_signal()
1450 union cmd cmd; in __cmd_stop() local
1461 memset(&cmd, 0, sizeof(cmd)); in __cmd_stop()
1462 cmd.cmd = CMD_STOP; in __cmd_stop()
1463 return send_cmd(daemon, &cmd); in __cmd_stop()
1476 union cmd cmd; in __cmd_ping() local
1487 memset(&cmd, 0, sizeof(cmd)); in __cmd_ping()
1488 cmd.cmd = CMD_PING; in __cmd_ping()
1489 scnprintf(cmd.ping.name, sizeof(cmd.ping.name), "%s", name); in __cmd_ping()
1490 return send_cmd(daemon, &cmd); in __cmd_ping()