From 02d0c15a77210f8636f51168444d4003148bea54 Mon Sep 17 00:00:00 2001 From: Bryan Stansell Date: Thu, 30 Apr 2020 18:58:56 -0700 Subject: [PATCH 1/3] Fix #38 - task execution error message --- conserver/cutil.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/conserver/cutil.c b/conserver/cutil.c index 24ce826..0d50911 100644 --- a/conserver/cutil.c +++ b/conserver/cutil.c @@ -890,7 +890,10 @@ FileRead(CONSFILE *cfp, void *buf, int len) case simpleSocket: while (retval < 0) { if ((retval = read(cfp->fd, buf, len)) <= 0) { - if (retval == 0) { + CONDDEBUG((2, + "FileRead(): read(): fd=%d, retval=%d, errno=%d", + cfp->fd, retval, errno)); + if (retval == 0 || errno == EIO) { retval = -1; break; } @@ -1067,6 +1070,9 @@ FileWrite(CONSFILE *cfp, FLAG bufferonly, char *buf, int len) case simpleSocket: while (len > 0) { if ((retval = write(fdout, buf, len)) < 0) { + CONDDEBUG((2, + "FileWrite(): write(): fd=%d, retval=%d, errno=%d, len=%d", + fdout, retval, errno, len)); if (errno == EINTR) continue; if (errno == EAGAIN) { @@ -1941,11 +1947,11 @@ ProbeInterfaces(in_addr_t bindAddr) if ((ifc.ifc_len - r) < sizeof(*ifr)) break; # ifdef HAVE_SA_LEN -# ifdef __FreeBSD__ +# ifdef __FreeBSD__ if (sa->sa_len > sizeof(ifr->ifr_addr)) -# else +# else if (sa->sa_len > sizeof(ifr->ifr_ifru)) -# endif +# endif r += sizeof(ifr->ifr_name) + sa->sa_len; else # endif From 55738e4e974f54e278145069f11f940eb27a35aa Mon Sep 17 00:00:00 2001 From: Bryan Stansell Date: Thu, 30 Apr 2020 19:41:18 -0700 Subject: [PATCH 2/3] Prevent GetMaxFiles() debug output from going to forked processes --- conserver/cutil.c | 1 - conserver/main.c | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/conserver/cutil.c b/conserver/cutil.c index 0d50911..d0075f9 100644 --- a/conserver/cutil.c +++ b/conserver/cutil.c @@ -590,7 +590,6 @@ GetMaxFiles(void) mf = (FD_SETSIZE - 1); } #endif - CONDDEBUG((1, "GetMaxFiles(): maxfiles=%d", mf)); return mf; } diff --git a/conserver/main.c b/conserver/main.c index a9ff5b3..37abf5f 100644 --- a/conserver/main.c +++ b/conserver/main.c @@ -1452,6 +1452,10 @@ main(int argc, char **argv) #if !USE_IPV6 ProbeInterfaces(bindAddr); #endif +#if !HAVE_CLOSEFROM + i = GetMaxFiles(); + CONDDEBUG((1, "main(): GetMaxFiles=%d", i)); +#endif /* initialize the timers */ for (i = 0; i < T_MAX; i++) From 2d8a816b62c256daaba453bc07ab95f0e9fee912 Mon Sep 17 00:00:00 2001 From: Bryan Stansell Date: Thu, 30 Apr 2020 20:14:43 -0700 Subject: [PATCH 3/3] changing freebsd spec to match https://cirrus-ci.org/guide/FreeBSD/ --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index b2d4049..fc7459e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -3,7 +3,7 @@ env: freebsd_12_task: freebsd_instance: - image: freebsd-12-0-release-amd64 + image_family: freebsd-12-1 install_script: - pkg install -y autoconf automake - ./package/setup-configure