fix tests for solaris
This commit is contained in:
parent
2e468c0b69
commit
7e32a8825a
|
@ -1,4 +1,4 @@
|
|||
/* $Id: testgetifaddr.c,v 1.3 2011/04/11 10:41:57 nanard Exp $ */
|
||||
/* $Id: testgetifaddr.c,v 1.4 2012/03/05 20:36:17 nanard Exp $ */
|
||||
/* MiniUPnP project
|
||||
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
||||
* (c) 2006-2011 Thomas Bernard
|
||||
|
@ -8,12 +8,18 @@
|
|||
#include <syslog.h>
|
||||
#include "getifaddr.h"
|
||||
|
||||
#if defined(__sun)
|
||||
/* solaris 10 does not define LOG_PERROR */
|
||||
#define LOG_PERROR 0
|
||||
#endif
|
||||
|
||||
int main(int argc, char * * argv) {
|
||||
char addr[64];
|
||||
if(argc < 2) {
|
||||
fprintf(stderr, "Usage:\t%s interface_name\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
openlog("testgetifaddr", LOG_CONS|LOG_PERROR, LOG_USER);
|
||||
if(getifaddr(argv[1], addr, sizeof(addr)) < 0) {
|
||||
fprintf(stderr, "Cannot get address for interface %s.\n", argv[1]);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: testgetifstats.c,v 1.4 2007/02/07 22:14:47 nanard Exp $ */
|
||||
/* $Id: testgetifstats.c,v 1.5 2012/03/05 20:36:17 nanard Exp $ */
|
||||
/* MiniUPnP project
|
||||
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
||||
* (c) 2006 Thomas Bernard
|
||||
|
@ -11,6 +11,11 @@
|
|||
|
||||
#include "getifstats.h"
|
||||
|
||||
#if defined(__sun)
|
||||
/* solaris 10 does not define LOG_PERROR */
|
||||
#define LOG_PERROR 0
|
||||
#endif
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue