Skip to content

Commit

Permalink
Merge branch 'binlog'
Browse files Browse the repository at this point in the history
  • Loading branch information
kr committed Nov 14, 2008
2 parents 2d4b7e8 + 950e777 commit eb6c824
Show file tree
Hide file tree
Showing 11 changed files with 510 additions and 47 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ tests/cutcheck*
tests/cutgen
stamp-h1
version.h
.*.swp
3 changes: 2 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ beanstalkd_SOURCES = beanstalkd.c \
primes.c \
prot.c \
tube.c \
binlog.c \
util.c

cutgen_CFLAGS = -D__LINUX__

EXTRA_DIST = conn.h job.h ms.h net.h pq.h primes.h prot.h stat.h tube.h util.h
EXTRA_DIST = conn.h job.h ms.h net.h pq.h primes.h prot.h stat.h tube.h util.h binlog.h

tests = $(abs_srcdir)/tests/test_conn.c \
$(abs_srcdir)/tests/test_job.c \
Expand Down
9 changes: 9 additions & 0 deletions beanstalkd.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "util.h"
#include "prot.h"
#include "version.h"
#include "binlog.h"

static char *user = NULL;
static int detach = 0;
Expand Down Expand Up @@ -93,6 +94,7 @@ su(const char *user) {
void
exit_cleanly(int sig)
{
binlog_close();
exit(0);
}

Expand Down Expand Up @@ -153,6 +155,7 @@ usage(char *msg, char *arg)
"\n"
"Options:\n"
" -d detach\n"
" -b DIR binlog directory\n"
" -l ADDR listen on address (default is 0.0.0.0)\n"
" -p PORT listen on port (default is 11300)\n"
" -u USER become user and group\n"
Expand Down Expand Up @@ -225,6 +228,9 @@ opts(int argc, char **argv)
case 'u':
user = argv[++i];
break;
case 'b':
binlog_dir = argv[++i];
break;
case 'h':
usage(NULL, NULL);
case 'v':
Expand Down Expand Up @@ -257,8 +263,11 @@ main(int argc, char **argv)
nudge_fd_limit();

unbrake((evh) h_accept);
prot_replay_binlog();
binlog_init();

event_dispatch();
binlog_close();
twarnx("got here for some reason");
return 0;
}
Loading

0 comments on commit eb6c824

Please sign in to comment.