From de534fed839ae8ea9698177819611f593dd9b142 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 14 Mar 2018 14:46:23 +0000 Subject: [PATCH] cleaned up code a bit --- lib/Makefile.in | 1 + lib/hcl-s.c | 7 ++----- lib/main2.c | 14 +------------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/lib/Makefile.in b/lib/Makefile.in index caa866e..44dea0a 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -435,6 +435,7 @@ pkglib_LTLIBRARIES = libhcl.la $(am__append_3) libhcl_la_SOURCES = \ hcl-prv.h \ logfmtv.h \ + sa-utl.h \ bigint.c \ comp.c \ debug.c \ diff --git a/lib/hcl-s.c b/lib/hcl-s.c index 1c2766e..9b55bbe 100644 --- a/lib/hcl-s.c +++ b/lib/hcl-s.c @@ -82,11 +82,9 @@ # if defined(HAVE_SYS_MMAN_H) # include # endif - -# include + # include # include - # include # include # include @@ -1792,8 +1790,7 @@ static void set_err_with_syserr (hcl_server_t* server, int syserr, const char* b int hcl_server_start (hcl_server_t* server, const hcl_bch_t* addrs) { sockaddr_t srv_addr; - int srv_fd, sck_fam; - int optval; + int srv_fd, sck_fam, optval; socklen_t srv_len; pthread_attr_t thr_attr; diff --git a/lib/main2.c b/lib/main2.c index 606bd52..a1ea020 100644 --- a/lib/main2.c +++ b/lib/main2.c @@ -31,11 +31,8 @@ #include #include #include -#include #include #include -#include - #if defined(HAVE_TIME_H) # include @@ -46,19 +43,10 @@ #if defined(HAVE_SIGNAL_H) # include #endif -#if defined(HAVE_SYS_MMAN_H) -# include -#endif -#include #include #include -#include -#include -#include -#include - /* ========================================================================= */ typedef struct server_xtn_t server_xtn_t; @@ -215,7 +203,7 @@ static void log_write (hcl_server_t* server, int wid, unsigned int mask, const h * write what have been converted this round. */ /*HCL_ASSERT (hcl, ucslen > 0); */ /* if this fails, the buffer size must be increased */ - assert (ucslen > 0); + /*assert (ucslen > 0);*/ /* attempt to write all converted characters */ if (write_all(logfd, buf, bcslen) <= -1) break;