diff options
author | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2011-06-25 23:11:47 +0800 |
---|---|---|
committer | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2011-06-25 23:11:47 +0800 |
commit | 68b30fce07b70e9ef74b948001ed009f86a3744c (patch) | |
tree | f6c209f72f4bbbdfc4eae2e1592672c00331390b | |
parent | d8bea5e822a885b75bbc268bba81517a10579576 (diff) | |
download | pttbbs-68b30fce07b70e9ef74b948001ed009f86a3744c.tar pttbbs-68b30fce07b70e9ef74b948001ed009f86a3744c.tar.gz pttbbs-68b30fce07b70e9ef74b948001ed009f86a3744c.tar.bz2 pttbbs-68b30fce07b70e9ef74b948001ed009f86a3744c.tar.lz pttbbs-68b30fce07b70e9ef74b948001ed009f86a3744c.tar.xz pttbbs-68b30fce07b70e9ef74b948001ed009f86a3744c.tar.zst pttbbs-68b30fce07b70e9ef74b948001ed009f86a3744c.zip |
Common timeout should be global.
Fix usage line.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5363 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/daemon/barebone/server.c | 6 | ||||
-rw-r--r-- | pttbbs/daemon/barebone/server.h | 2 |
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, |