Skip to content

Instantly share code, notes, and snippets.

@adaugherity
Last active June 29, 2017 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adaugherity/87f1466b3c93d5aed205a636169d1c58 to your computer and use it in GitHub Desktop.
Save adaugherity/87f1466b3c93d5aed205a636169d1c58 to your computer and use it in GitHub Desktop.
Date: Wed, 26 Apr 2017 17:24:15 -0500
Subject: [PATCH] Fix segfault on macOS due to getpass()
The prototype is not present when _XOPEN_SOURCE >= 600; unlike other
BSDs, macOS does not include it when _BSD_SOURCE is defined.
Also remove bogus _BSD_SOURCE definition.
Submitted upstream: https://sourceforge.net/p/ipmitool/bugs/433/#89ea
---
lib/ipmi_main.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/lib/ipmi_main.c b/lib/ipmi_main.c
index 811c80b..c9890c2 100644
--- a/lib/ipmi_main.c
+++ b/lib/ipmi_main.c
@@ -29,11 +29,7 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _XOPEN_SOURCE 700
-#define _BSD_SOURCE || \
- (_XOPEN_SOURCE >= 500 || \
- _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) && \
- !(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
+#define _XOPEN_SOURCE 500
#include <stdlib.h>
#include <stdio.h>
--
2.11.0 (Apple Git-81)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment