From eda71798749e8b0abf5e8b3cbc11da82aa607f00 Mon Sep 17 00:00:00 2001 From: Timothy Redaelli Date: Tue, 4 May 2010 15:43:48 +0200 Subject: [PATCH] Fix warnings under BSD --- lib/getopt.c | 26 ++++++++++++++++---------- src/net_packet.c | 2 ++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/lib/getopt.c b/lib/getopt.c index b2f88b42..a6782ed6 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -44,6 +44,10 @@ with this program; if not, write to the Free Software Foundation, Inc., #include +#ifdef HAVE_STRING_H +#include +#endif + /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling @@ -688,16 +692,18 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) else { if (opterr) - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - "%s: option `--%s' doesn't allow an argument\n", - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - "%s: option `%c%s' doesn't allow an argument\n", - argv[0], argv[optind - 1][0], pfound->name); + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + "%s: option `--%s' doesn't allow an argument\n", + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + "%s: option `%c%s' doesn't allow an argument\n", + argv[0], argv[optind - 1][0], pfound->name); + } nextchar += strlen (nextchar); diff --git a/src/net_packet.c b/src/net_packet.c index a438d3e9..cf5fb939 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -365,7 +365,9 @@ static void send_udppacket(node_t *n, vpn_packet_t *origpkt) { vpn_packet_t *outpkt; int origlen; int outlen, outpad; +#if defined(SOL_IP) && defined(IP_TOS) static int priority = 0; +#endif int origpriority; int sock; -- 2.39.5