summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pttbbs/daemon/barebone/server.c6
-rw-r--r--pttbbs/daemon/barebone/server.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/pttbbs/daemon/barebone/server.c b/pttbbs/daemon/barebone/server.c
index bfb1c4da..df347abd 100644
--- a/pttbbs/daemon/barebone/server.c
+++ b/pttbbs/daemon/barebone/server.c
@@ -32,7 +32,8 @@
#include "server.h"
-static const struct timeval *common_timeout;
+static const struct timeval timeout = {600, 0};
+const struct timeval *common_timeout = &timeout;
int
split_args(char *line, char ***argp)
@@ -114,7 +115,7 @@ int main(int argc, char *argv[])
break;
case 'h':
default:
- fprintf(stderr, "usage: " " [-D] [-i] [-l interface_ip:port]\n");
+ fprintf(stderr, "Usage: %s [-D] [-i] [-l interface_ip:port]\n", argv[0]);
exit(EXIT_FAILURE);
}
@@ -127,7 +128,6 @@ int main(int argc, char *argv[])
base = event_base_new();
assert(base);
- const struct timeval timeout = {600, 0};
common_timeout = event_base_init_common_timeout(base, &timeout);
if (!inetd) {
diff --git a/pttbbs/daemon/barebone/server.h b/pttbbs/daemon/barebone/server.h
index 9cba93b7..1a6822e5 100644
--- a/pttbbs/daemon/barebone/server.h
+++ b/pttbbs/daemon/barebone/server.h
@@ -10,6 +10,8 @@
#define MAX_ARGS 100
#endif
+extern const struct timeval *common_timeout;
+
extern void client_read_cb(struct bufferevent *bev, void *ctx);
extern void client_event_cb(struct bufferevent *bev, short events, void *ctx);
extern void setup_client(struct event_base *base, evutil_socket_t fd,