* 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
This commit is contained in:
Axel Dörfler 2010-08-11 12:45:48 +00:00
parent 3794b8e560
commit 584866c82f
2 changed files with 8 additions and 44 deletions

View File

@ -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 :

View File

@ -110,6 +110,7 @@
#include <netdb.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <math.h>
@ -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");