cleaned up code a bit

This commit is contained in:
hyung-hwan 2018-03-14 14:46:23 +00:00
parent 25b71a4800
commit de534fed83
3 changed files with 4 additions and 18 deletions

View File

@ -435,6 +435,7 @@ pkglib_LTLIBRARIES = libhcl.la $(am__append_3)
libhcl_la_SOURCES = \ libhcl_la_SOURCES = \
hcl-prv.h \ hcl-prv.h \
logfmtv.h \ logfmtv.h \
sa-utl.h \
bigint.c \ bigint.c \
comp.c \ comp.c \
debug.c \ debug.c \

View File

@ -83,10 +83,8 @@
# include <sys/mman.h> # include <sys/mman.h>
# endif # endif
# include <errno.h>
# include <unistd.h> # include <unistd.h>
# include <fcntl.h> # include <fcntl.h>
# include <sys/types.h> # include <sys/types.h>
# include <sys/socket.h> # include <sys/socket.h>
# include <netinet/in.h> # include <netinet/in.h>
@ -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) int hcl_server_start (hcl_server_t* server, const hcl_bch_t* addrs)
{ {
sockaddr_t srv_addr; sockaddr_t srv_addr;
int srv_fd, sck_fam; int srv_fd, sck_fam, optval;
int optval;
socklen_t srv_len; socklen_t srv_len;
pthread_attr_t thr_attr; pthread_attr_t thr_attr;

View File

@ -31,11 +31,8 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <limits.h>
#include <errno.h> #include <errno.h>
#include <locale.h> #include <locale.h>
#include <assert.h>
#if defined(HAVE_TIME_H) #if defined(HAVE_TIME_H)
# include <time.h> # include <time.h>
@ -46,19 +43,10 @@
#if defined(HAVE_SIGNAL_H) #if defined(HAVE_SIGNAL_H)
# include <signal.h> # include <signal.h>
#endif #endif
#if defined(HAVE_SYS_MMAN_H)
# include <sys/mman.h>
#endif
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
/* ========================================================================= */ /* ========================================================================= */
typedef struct server_xtn_t server_xtn_t; 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. */ * write what have been converted this round. */
/*HCL_ASSERT (hcl, ucslen > 0); */ /* if this fails, the buffer size must be increased */ /*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 */ /* attempt to write all converted characters */
if (write_all(logfd, buf, bcslen) <= -1) break; if (write_all(logfd, buf, bcslen) <= -1) break;