[tor-commits] [tor/master] Add a #ifdef HAVE_UNISTD_H check to buffers.c

nickm at torproject.org nickm at torproject.org
Thu Jan 3 14:52:32 UTC 2019


commit 4e4f93d364e33bb46e271f3b960a2cf5f38f402e
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu Jan 3 09:50:54 2019 -0500

    Add a #ifdef HAVE_UNISTD_H check to buffers.c
    
    Reported on tor-dev by Gisle Vanem.  Bug not in any released Tor
    
    (The suggested patch used _MSC_VER, but that's not how we do stuff
    with autoconf.  With autoconf, you detect the feature you want,
    rather than trying to list all the systems that do or do not have
    it.)
---
 src/lib/net/buffers_net.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lib/net/buffers_net.c b/src/lib/net/buffers_net.c
index 576dc56a5..a4c0aca3b 100644
--- a/src/lib/net/buffers_net.c
+++ b/src/lib/net/buffers_net.c
@@ -21,7 +21,10 @@
 #endif
 
 #include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #ifdef PARANOIA
 /** Helper: If PARANOIA is defined, assert that the buffer in local variable



More information about the tor-commits mailing list