From: Thibault Godouet Date: Mon, 2 May 2016 09:33:40 +0000 (+0100) Subject: recv() returns ssize_t (not size_t) X-Git-Tag: ver3_3_0~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e046ec9340eead2e85c6641dce8006a219432bc;p=thirdparty%2Ffcron.git recv() returns ssize_t (not size_t) --- diff --git a/config.h.in b/config.h.in index 5fef4be..74dc8f8 100644 --- a/config.h.in +++ b/config.h.in @@ -206,6 +206,9 @@ /* Define to `unsigned' if doesn't define. */ #undef size_t +/* Define to `int' if does not define. */ +#undef ssize_t + /* Define to `int' if doesn't define. */ #undef uid_t diff --git a/configure.in b/configure.in index ff4ee91..37142a5 100644 --- a/configure.in +++ b/configure.in @@ -59,8 +59,6 @@ AC_CHECK_HEADERS(security/pam_appl.h pam/pam_appl.h crypt.h shadow.h libaudit.h) AC_CHECK_HEADERS(sys/resource.h) AC_CHECK_HEADERS(grp.h) -AC_CHECK_SIZEOF(time_t) - dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T @@ -69,7 +67,11 @@ AC_HEADER_TIME AC_STRUCT_TM AC_TYPE_UID_T +dnl Check exitence of types +AC_CHECK_TYPE(ssize_t, int) + dnl Define sizeof constants +AC_CHECK_SIZEOF(time_t) AC_CHECK_SIZEOF(pid_t) AC_CHECK_SIZEOF(time_t) AC_CHECK_SIZEOF(short int) diff --git a/fcrondyn.c b/fcrondyn.c index f3616c4..5334d5f 100644 --- a/fcrondyn.c +++ b/fcrondyn.c @@ -482,7 +482,7 @@ talk_fcron(char *cmd_str, int fd) long int *cmd = NULL; int cmd_len = 0; char buf[LINE_LEN]; - size_t read_len = 0; + ssize_t read_len = 0; char existing_connection = (fd < 0) ? 0 : 1; fd_set read_set; /* needed to use select to check if some data is waiting */ struct timeval tv; @@ -578,7 +578,7 @@ talk_fcron(char *cmd_str, int fd) } - while ((read_len = (size_t) recv(fd, buf, sizeof(buf) - 1, 0)) >= 0 + while ((read_len = recv(fd, buf, sizeof(buf) - 1, 0)) >= 0 || errno == EINTR) { if (errno == EINTR && debug_opt)