Always include stdbool.h.
[paraslash.git] / command.c
index 69bbbb74dd2831791e0f24378d7a4c4451bb6524..aa827f2b1cdc9ffd9984379b55c02223addcca1b 100644 (file)
--- a/command.c
+++ b/command.c
@@ -11,7 +11,6 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include <osl.h>
-#include <stdbool.h>
 
 #include "para.h"
 #include "error.h"
@@ -24,6 +23,7 @@
 #include "server.h"
 #include "list.h"
 #include "send.h"
+#include "sched.h"
 #include "vss.h"
 #include "net.h"
 #include "daemon.h"
@@ -32,7 +32,6 @@
 #include "user_list.h"
 #include "server_command_list.h"
 #include "afs_command_list.h"
-#include "sched.h"
 #include "signal.h"
 #include "version.h"
 
@@ -108,7 +107,8 @@ static char *get_status(struct misc_meta_data *nmmd, int parser_friendly)
 {
        char mtime[30] = "";
        char *status, *flags; /* vss status info */
-       char *ut = uptime_str();
+       /* nobody updates our version of "now" */
+       char *ut = get_server_uptime_str(NULL);
        long offset = (nmmd->offset + 500) / 1000;
        struct timeval current_time;
        struct tm mtime_tm;
@@ -258,7 +258,7 @@ int com_si(struct stream_cipher_context *scc, int argc, __a_unused char * const
                sender_info = para_strcat(sender_info, info);
                free(info);
        }
-       ut = uptime_str();
+       ut = get_server_uptime_str(now);
        ret = sc_send_va_buffer(scc, "version: " GIT_VERSION "\n"
                "up: %s\nplayed: %u\n"
                "server_pid: %d\n"
@@ -762,13 +762,11 @@ __noreturn void handle_connect(int fd, const char *peername)
                ret = -E_AUTH_REQUEST;
                goto net_err;
        }
-       numbytes = ret;
        ret = -E_AUTH_REQUEST;
        if (strncmp(buf, AUTH_REQUEST_MSG, strlen(AUTH_REQUEST_MSG)))
                goto net_err;
        p = buf + strlen(AUTH_REQUEST_MSG);
        PARA_DEBUG_LOG("received auth request for user %s\n", p);
-       ret = -E_BAD_USER;
        u = lookup_user(p);
        if (u) {
                get_random_bytes_or_die(rand_buf, sizeof(rand_buf));