Created
April 27, 2012 06:39
-
-
Save schweikert/2506666 to your computer and use it in GitHub Desktop.
fping 3.1 Solaris 8 patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- fping.c-orig 2011-12-22 16:05:18.000000000 +0100 | |
+++ fping.c 2012-01-13 17:47:08.000000000 +0100 | |
@@ -386,6 +386,37 @@ | |
#endif /* _NO_PROTO */ | |
+#if defined (__SVR4) && defined (__sun) | |
+/* on Solaris use code from glibc's misc/err.c because the IPv6 support needs it */ | |
+#include <stdarg.h> | |
+extern char *prog; /* set by fping.c */ | |
+extern int errno; | |
+ | |
+static void err(int status, const char* format, ...) { | |
+ int error = errno; | |
+ fprintf (stderr, "%s: ", prog); | |
+ if (format) { | |
+ va_list ap; | |
+ va_start(ap, format); | |
+ vfprintf (stderr, format, ap); | |
+ va_end (ap); | |
+ } | |
+ fprintf (stderr, "%s\n", strerror(error)); | |
+ exit(status); | |
+} | |
+ | |
+static void warnx(const char* format, ...) { | |
+ fprintf (stderr, "%s: ", prog); | |
+ if (format) { | |
+ va_list ap; | |
+ va_start (ap, format); | |
+ vfprintf (stderr, format, ap); | |
+ va_end (ap); | |
+ } | |
+ fprintf (stderr, "\n"); | |
+} | |
+#endif /* Solaris */ | |
+ | |
/*** function definitions ***/ | |
/************************************************************ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment