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");