/**
* Object oriented C module to send ICMP and ICMPv6 `echo's.
- * Copyright (C) 2006-2010 Florian octo Forster <ff at octo.it>
+ * Copyright (C) 2006-2011 Florian octo Forster <ff at octo.it>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
# define _POSIX_SAVED_IDS 0
#endif
+#ifndef IPTOS_MINCOST
+# define IPTOS_MINCOST 0x02
+#endif
+
/* Remove GNU specific __attribute__ settings when using another compiler */
#if !__GNUC__
# define __attribute__(x) /**/
exit (status);
} /* }}} void usage_exit */
+__attribute__((noreturn))
static void usage_qos_exit (const char *arg, int status) /* {{{ */
{
if (arg != 0)
&& (strlen (opt) == 4))
{
uint8_t dscp;
- uint8_t class;
- uint8_t prec;
+ uint8_t class = 0;
+ uint8_t prec = 0;
/* There are four classes, AF1x, AF2x, AF3x, and AF4x. */
if (opt[2] == '1')
context->window = NULL;
}
context->window = newwin (/* height = */ 4,
- /* width = */ 0,
+ /* width = */ width,
/* y = */ main_win_height + (4 * context->index),
/* x = */ 0);
}
main_win_height = height - (4 * host_num);
main_win = newwin (/* height = */ main_win_height,
- /* width = */ 0,
+ /* width = */ width,
/* y = */ 0, /* x = */ 0);
/* Allow scrolling */
scrollok (main_win, TRUE);
context->window = NULL;
}
context->window = newwin (/* height = */ 4,
- /* width = */ 0,
+ /* width = */ width,
/* y = */ main_win_height + (4 * context->index),
/* x = */ 0);
}
return (1);
}
- if (ping_send (ping) < 0)
+ status = ping_send (ping);
+ if (status == -EINTR)
+ {
+ continue;
+ }
+ else if (status < 0)
{
fprintf (stderr, "ping_send failed: %s\n",
ping_get_error (ping));
/* printf ("Sleeping for %i.%09li seconds\n", (int) ts_wait.tv_sec, ts_wait.tv_nsec); */
while ((status = nanosleep (&ts_wait, &ts_wait)) != 0)
{
- if (errno != EINTR)
+ if (errno == EINTR)
{
- perror ("nanosleep");
- break;
+ continue;
}
- else if (opt_count == 0)
+ else
{
- /* sigint */
+ perror ("nanosleep");
break;
}
}