Skip to content

Commit

Permalink
ZOOKEEPER-3078: remove print_completion_queue
Browse files Browse the repository at this point in the history
The fprintf(LOGSTREAM, ...) calls cause compiler errors when building
with GCC 8: "error: null argument where non-null required".  This is
because since ZOOKEEPER-1400 (2013-05-19 commit 37973fa: Allow logging
via callback instead of raw FILE pointer) LOGSTREAM is defined as NULL.
However, the last use of print_completion_queue was removed 2008-01-10
in commit ffc4b0d (Changed zoo_get() signature, changed the watcher
callback signature, fixed zookeeper_close() resource leaks and race
conditions, fixed the race condition causing xid mismatch).  So we can
avoid the compiler errors by just removing print_completion_queue.

Signed-off-by: Kent R. Spillner <kspillneracm.org>

Author: Kent R. Spillner <[email protected]>

Reviewers: Norbert Kalmar <[email protected]>, Andor Molnár <[email protected]>, Benjamin Reed <[email protected]>

Closes #558 from sl4mmy/zookeeper-3078
  • Loading branch information
sl4mmy authored and breed committed Jul 10, 2018
1 parent 5d187ff commit 32e4a16
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/c/src/zookeeper.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,6 @@ static void cleanup_bufs(zhandle_t *zh,int callCompletion,int rc);
static int disable_conn_permute=0; // permute enabled by default
static struct sockaddr_storage *addr_rw_server = 0;

static __attribute__((unused)) void print_completion_queue(zhandle_t *zh);

static void *SYNCHRONOUS_MARKER = (void*)&SYNCHRONOUS_MARKER;
static int isValidPath(const char* path, const int flags);

Expand Down Expand Up @@ -2530,26 +2528,6 @@ int api_epilog(zhandle_t *zh,int rc)
return rc;
}

static __attribute__((unused)) void print_completion_queue(zhandle_t *zh)
{
completion_list_t* cptr;

if(logLevel<ZOO_LOG_LEVEL_DEBUG) return;

fprintf(LOGSTREAM,"Completion queue: ");
if (zh->sent_requests.head==0) {
fprintf(LOGSTREAM,"empty\n");
return;
}

cptr=zh->sent_requests.head;
while(cptr){
fprintf(LOGSTREAM,"%d,",cptr->xid);
cptr=cptr->next;
}
fprintf(LOGSTREAM,"end\n");
}

//#ifdef THREADED
// IO thread queues session events to be processed by the completion thread
static int queue_session_event(zhandle_t *zh, int state)
Expand Down

0 comments on commit 32e4a16

Please sign in to comment.