Skip to content

Commit

Permalink
test/buffer: avoid errors with --no-fork (reinitialize static vars)
Browse files Browse the repository at this point in the history
  • Loading branch information
azat committed Jun 17, 2016
1 parent b5ca365 commit e7d1e39
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/regress_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,10 +706,10 @@ test_evbuffer_reference2(void *ptr)
evbuffer_free(buf);
}

static struct event_base *addfile_test_event_base = NULL;
static int addfile_test_done_writing = 0;
static int addfile_test_total_written = 0;
static int addfile_test_total_read = 0;
static struct event_base *addfile_test_event_base;
static int addfile_test_done_writing;
static int addfile_test_total_written;
static int addfile_test_total_read;

static void
addfile_test_writecb(evutil_socket_t fd, short what, void *arg)
Expand Down Expand Up @@ -911,6 +911,10 @@ test_evbuffer_add_file(void *ptr)
evbuffer_validate(src);

addfile_test_event_base = base;
addfile_test_done_writing = 0;
addfile_test_total_written = 0;
addfile_test_total_read = 0;

wev = event_new(base, pair[0], EV_WRITE|EV_PERSIST,
addfile_test_writecb, src);
rev = event_new(base, pair[1], EV_READ|EV_PERSIST,
Expand Down

0 comments on commit e7d1e39

Please sign in to comment.