diff options
author | Joerg Mayer <jmayer@loplof.de> | 2015-05-17 22:59:12 +0200 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2015-05-17 21:01:03 +0000 |
commit | 1c455284f0f6166beb4212614d4f1e2a177c7ebe (patch) | |
tree | cbfac0f75a321a3d84a03b5d10a0bf5338c05b0c /echld/parent.c | |
parent | 36af2c61e8dcdd692faf1fb9a9ed62c0dc4cd8ba (diff) |
Fix some files to pass the pre-commit hook script.
Change-Id: I105bf4e03fcf95cf7541f6377215809759fd933e
Reviewed-on: https://code.wireshark.org/review/8502
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Diffstat (limited to 'echld/parent.c')
-rw-r--r-- | echld/parent.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/echld/parent.c b/echld/parent.c index 267ca0fb1f..468291ec60 100644 --- a/echld/parent.c +++ b/echld/parent.c @@ -91,7 +91,7 @@ static void parent_dbg(int level, const char* fmt, ...) { } #define PARENT_DBG(attrs) parent_dbg attrs -#define PARENT_SEND(BYTEARR,CHILDNUM,TYPE,R_ID) do { long st = echld_write_frame(parent.dispatcher_fd, BYTEARR, CHILDNUM, TYPE, R_ID, NULL); PARENT_DBG((1,"SEND type='%s' chld_id=%d reqh_id=%d err_msg='%s'",TY(TYPE),CHILDNUM,R_ID, ( st >= 8 ? "ok" : ((st<0)?strerror(errno):"?") ) )); } while(0) +#define PARENT_SEND(BYTEARR,CHILDNUM,TYPE,R_ID) do { long st = echld_write_frame(parent.dispatcher_fd, BYTEARR, CHILDNUM, TYPE, R_ID, NULL); PARENT_DBG((1,"SEND type='%s' chld_id=%d reqh_id=%d err_msg='%s'",TY(TYPE),CHILDNUM,R_ID, ( st >= 8 ? "ok" : ((st<0)?g_strerror(errno):"?") ) )); } while(0) #else #define PARENT_DBG(attrs) @@ -128,18 +128,22 @@ static void parent_fatal(int exit_code, const char* fmt, ...) { } static void echld_cleanup(void) { - // int i; +#if 0 + int i; +#endif PARENT_DBG((4,"echld_cleanup starting")); - // for (i=0;i<ECHLD_MAX_CHILDREN;i++) { - // if ( parent.children[i].handlers ) g_array_free(parent.children[i].handlers,TRUE); - // if ( parent.children[i].reqs ) g_array_free(parent.children[i].reqs,TRUE); - // }; +#if 0 + for (i=0;i<ECHLD_MAX_CHILDREN;i++) { + if ( parent.children[i].handlers ) g_array_free(parent.children[i].handlers,TRUE); + if ( parent.children[i].reqs ) g_array_free(parent.children[i].reqs,TRUE); + }; - // g_free(parent.children); + g_free(parent.children); - // g_byte_array_free(parent.snd,TRUE); + g_byte_array_free(parent.snd,TRUE); +#endif PARENT_DBG((3,"echld_cleanup done")); @@ -240,7 +244,7 @@ void echld_initialize(echld_init_t* init) { pid = fork(); if ( pid < 0 ) { - PARENT_FATAL((CANNOT_FORK,"Failed to fork() reason='%s'",strerror(errno))); + PARENT_FATAL((CANNOT_FORK,"Failed to fork() reason='%s'",g_strerror(errno))); } else if ( pid == 0) { #ifdef PARENT_THREADS reader_realloc_buf = child_realloc_buff; @@ -285,8 +289,10 @@ void echld_initialize(echld_init_t* init) { parent.children[0].state = IDLE; signal(SIGCHLD,parent_reaper); - //close(to_disp[0]); - //close(from_disp[1]); +#if 0 + close(to_disp[0]); + close(from_disp[1]); +#endif if (init->dispatcher_hello_cb) echld_msgh(0, ECHLD_HELLO, hello_cb, init); PARENT_DBG((3,"Ready")); |