From 584866c82fc480710b68fa6fe4d51a56c784485a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 11 Aug 2010 12:45:48 +0000 Subject: [PATCH] * Patch by Atis: reverted a few changes made to the FreeBSD version of ping6.c, and use libutil.a. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38022 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/network/ping6/Jamfile | 15 +++----------- src/bin/network/ping6/ping6.c | 37 +++++------------------------------ 2 files changed, 8 insertions(+), 44 deletions(-) diff --git a/src/bin/network/ping6/Jamfile b/src/bin/network/ping6/Jamfile index 4a9d01d66a..9280506ba5 100644 --- a/src/bin/network/ping6/Jamfile +++ b/src/bin/network/ping6/Jamfile @@ -8,20 +8,11 @@ if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) { # Unfortunately we get more than we want, namely all POSIX headers. } +UseHeaders [ FDirName $(HAIKU_TOP) headers compatibility bsd ] : true ; + BinCommand ping6 : ping6.c - : $(TARGET_NETWORK_LIBS) $(TARGET_SELECT_UNAME_ETC_LIB) ; - -# Installation -- in the test directory for the time being -HaikuInstall install-networking - : [ FDirName $(HAIKU_TEST_DIR) kits net ] - : ping6 ; - -HaikuInstall install-userland-networking - : [ FDirName $(HAIKU_TEST_DIR) kits net userland ] - : ping6 - : installed-userland-networking -; + : libbsd.so $(TARGET_NETWORK_LIBS) $(TARGET_SELECT_UNAME_ETC_LIB) ; Package haiku-networkingkit-cvs : ping6 : diff --git a/src/bin/network/ping6/ping6.c b/src/bin/network/ping6/ping6.c index ee7987c2d7..be26138f66 100644 --- a/src/bin/network/ping6/ping6.c +++ b/src/bin/network/ping6/ping6.c @@ -110,6 +110,7 @@ #include #include +#include #include #include #include @@ -273,38 +274,6 @@ char *nigroup(char *); void usage(void); -static void err(int exitval, char *where) -{ - printf("error: %s: error %d [%s]\n", where, errno, strerror(errno)); - exit(exitval); -} - -static void errx(int exitval, char *fmt_string, ...) -{ - va_list list; - va_start(list, fmt_string); - printf("error: "); - vprintf(fmt_string, list); - printf("\n"); - va_end(list); - exit(exitval); -} - -static void warn(char *where) -{ - printf("warning: %s: error %d [%s]\n", where, errno, strerror(errno)); -} - -static void warnx(char *fmt_string, ...) -{ - va_list list; - va_start(list, fmt_string); - printf("warning: "); - vprintf(fmt_string, list); - printf("\n"); -} - - int main(argc, argv) int argc; @@ -701,6 +670,10 @@ main(argc, argv) #endif } + /* revoke root privilege */ + seteuid(getuid()); + setuid(getuid()); + if ((options & F_FLOOD) && (options & F_INTERVAL)) errx(1, "-f and -i incompatible options");