Browse Source

[core] portability tweaks for various platforms/cc

master
Glenn Strauss 2 months ago
parent
commit
3720908167
  1. 2
      src/chunk.c
  2. 5
      src/ck.c
  3. 2
      src/fdevent.c

2
src/chunk.c

@ -896,7 +896,7 @@ ssize_t chunkqueue_append_splice_pipe_tempfile(chunkqueue * const restrict cq, c
return total;
case EINVAL: /*(assume total == 0 if EINVAL)*/
wr = chunkqueue_append_drain_pipe_tempfile(cq, fd, len, errh);
return (0 == wr) ? total + len : wr;
return (0 == wr) ? total + (ssize_t)len : wr;
default:
if (!chunkqueue_append_tempfile_err(cq, errh, c))
return -errnum;

5
src/ck.c

@ -16,6 +16,11 @@
#ifndef _NETBSD_SOURCE
#define _NETBSD_SOURCE
#endif
#ifdef __OpenBSD__
#ifndef _BSD_SOURCE
#define _BSD_SOURCE
#endif
#endif
#include "first.h"
#include "ck.h"

2
src/fdevent.c

@ -638,6 +638,8 @@ int fdevent_pipe_cloexec (int * const fds, const unsigned int bufsz_hint) {
#ifdef F_SETPIPE_SZ
if (bufsz_hint > 65536)
if (0 != fcntl(fds[1], F_SETPIPE_SZ, bufsz_hint)) { } /*(ignore error)*/
#else
UNUSED(bufsz_hint);
#endif
return 0;
#endif

Loading…
Cancel
Save