Skip to content

Commit

Permalink
Include missing sys/time.h
Browse files Browse the repository at this point in the history
This is found when building for musl C library systems where sys/time.h
is not included indirectly and select() and timeval structs are used

Fixes

../../git/tests/receive.c:64:17: error: variable has incomplete type 'struct timeval'
   64 |         struct timeval tvSelectTimeout;
      |                        ^
../../git/tests/receive.c:64:9: note: forward declaration of 'struct timeval'
   64 |         struct timeval tvSelectTimeout;
      |                ^
../../git/tests/receive.c:67:2: error: call to undeclared function 'select'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   67 |         select(0, NULL, NULL, NULL, &tvSelectTimeout);
      |         ^

Signed-off-by: Khem Raj <raj.khem@gmail.com>
  • Loading branch information
kraj committed Aug 19, 2023
1 parent 27d9a8c commit 8243a54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/receive.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <limits.h>
#include <errno.h>
#include <signal.h>
#include <sys/time.h>
#include "librelp.h"

#define TRY(f) { const int TRY_r = f; if(TRY_r != RELP_RET_OK) { \
Expand Down Expand Up @@ -68,7 +69,7 @@ doSleep(int iSeconds, const int iuSeconds)
}

static void
hdlr_enable(int sig, void (*hdlr)())
hdlr_enable(int sig, void (*hdlr)(const int))
{
struct sigaction sigAct;
memset(&sigAct, 0, sizeof (sigAct));
Expand Down

0 comments on commit 8243a54

Please sign in to comment.