Skip to content

Commit

Permalink
Check if SOCK_NONBLOCK is available otherwise use O_NONBLOCK fron fcn…
Browse files Browse the repository at this point in the history
…tl.h
  • Loading branch information
krihal committed Aug 19, 2024
1 parent e368039 commit 8402703
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/restconf/restconf_main_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@
#include "restconf_http1.h"
#endif

#ifndef SOCK_NONBLOCK
#include <fcntl.h>
#define SOCK_NONBLOCK O_NONBLOCK
#endif

/* Command line options to be passed to getopt(3) */
#define RESTCONF_OPTS "hVD:f:E:l:C:p:y:a:u:rW:R:t:o:"

Expand Down Expand Up @@ -761,7 +766,7 @@ openssl_init_socket(clixon_handle h,
if (restconf_socket_init(netns, address, addrtype, port,
SOCKET_LISTEN_BACKLOG,
#ifdef RESTCONF_OPENSSL_NONBLOCKING
SOCK_NONBLOCK, /* Also 0 is possible */
SOCK_NONBLOCK, /* Also 0 is possible */
#else /* blocking */
0,
#endif
Expand Down

0 comments on commit 8402703

Please sign in to comment.