Skip to content

Instantly share code, notes, and snippets.

@yugui
Created April 18, 2010 14:16
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 yugui/370234 to your computer and use it in GitHub Desktop.
Save yugui/370234 to your computer and use it in GitHub Desktop.
patch for apcupsd on AIX 5.2
--- src/lib/getopt.c.orig 2010-04-18 08:54:21.000000000 -0500
+++ src/lib/getopt.c 2010-04-18 08:54:34.000000000 -0500
@@ -57,7 +57,9 @@
#ifdef __GNU_LIBRARY__
/* Don't include stdlib.h for non-GNU C libraries because some of them
contain conflicting prototypes for getopt. */
+#ifndef _AIX
#include <stdlib.h>
+#endif
#endif /* GNU C library. */
/* This is for other GNU distributions with internationalized messages.
@@ -177,7 +179,11 @@ static char *posixly_correct;
whose names are inconsistent. */
/* ADK: No, let's just include the darn thing and be done with it. */
/* char *getenv (); */
+#ifndef _AIX
#include <stdlib.h>
+#else
+char *getenv(const char* name);
+#endif
static char *
my_index (const char *str, int chr)
@@ -291,7 +297,7 @@ _getopt_initialize (const char *optstrin
nextchar = NULL;
- posixly_correct = getenv ("POSIXLY_CORRECT");
+ posixly_correct = 0;/*getenv ("POSIXLY_CORRECT");*/
/* Determine how to handle the ordering of options and nonoptions. */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment