Skip to contentSkip to conversation

include unistd.h for _exit(2) declaration

PATCH In review Heiko Hund 2 participants 3 messages May 27, 2022

lore
Share & tools
lore

Heiko Hund

author
#0 lore raw

PATCH 1/1 include unistd.h for _exit(2) declaration

---
 src/openvpn/error.h | 2 ++
 1 file changed, 2 insertions(+)
src/openvpn/error.h +2 -0
index 972619fe..76308560 100644
@@ -33,6 +33,8 @@
 
 #if _WIN32
 #include <windows.h>
+#else
+#include <unistd.h>
 #endif
 
 /* #define ABORT_ON_ERROR */
Signature · 1 line
2.32.0
#1 lore raw

Hi,

Quoted 10 lines · Heiko Hund
---
 src/openvpn/error.h | 2 ++
 1 file changed, 2 insertions(+)
src/openvpn/error.h +0 -0
index 972619fe..76308560 100644

src/openvpn/error.h line 40

Quoted 8 lines
src/openvpn/error.h +2 -0
@@ -33,6 +33,8 @@
 
 #if _WIN32
 #include <windows.h>
+#else
+#include <unistd.h>
 #endif
 
 /* #define ABORT_ON_ERROR */

<unistd.h> is included by "syshead.h" already today, with a nice HAVE_UNISTD_H wraper (thus, not depending on a "if it's not WIN32, it surely must have unistd.h" assumption).

So I wonder what issue this fixes? I see no compile time warnings about _exit() either.

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
author
#2 lore raw

Hi Gert

Quoted 6 lines · On Freitag, 27. Mai 2022 13:40:57 CEST Gert Doering wrote:

<unistd.h> is included by "syshead.h" already today, with a nice HAVE_UNISTD_H wraper (thus, not depending on a "if it's not WIN32, it surely must have unistd.h" assumption).

So I wonder what issue this fixes? I see no compile time warnings about _exit() either.

I get "Implicit declaration of function '_exit' is invalid in C99 [-Wimplicit- function-declaration]" complaints from my semantic analyzer, but it's because it didn't pick up the -DHAVE_CONFIG_H. So I think that can be ignored indeed. Apologies for the noise.

Heiko