summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 92cd137)
raw | patch | inline | side by side (parent: 92cd137)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Fri, 8 Aug 2003 04:33:21 +0000 (04:33 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Fri, 8 Aug 2003 04:33:21 +0000 (04:33 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@662 f882894a-f735-0410-b71e-b25c423dba1c
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c
index 1211daa33d593fd11c3c8153e2085f02679a4e70..8527b727e1df458d4a388dd435ded0b75c731d4f 100644 (file)
--- a/plugins/check_by_ssh.c
+++ b/plugins/check_by_ssh.c
/******************************************************************************
- *
- * This file is part of the Nagios Plugins.
- *
- * Copyright (c) 1999, 2000, 2001 Karl DeBisschop <karl@debisschop.net>
- *
- * The Nagios Plugins are free software; you can redistribute them
- * and/or modify them under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
- *
+
+ The Nagios Plugins are free software; you can redistribute them
+ and/or modify them under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
*****************************************************************************/
const char *progname = "check_by_ssh";
const char *copyright = "2000-2003";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
-#include "config.h"
#include "common.h"
#include "netutils.h"
#include "utils.h"
void print_help (void);
void print_usage (void);
-void
-print_help (void)
-{
- print_revision (progname, revision);
-
- printf (_(COPYRIGHT), copyright, email);
-
- printf (_("This plugin uses SSH to execute commands on a remote host\n\n"));
-
- print_usage ();
-
- printf (_(UT_HELP_VRSN));
-
- printf (_(UT_HOST_PORT), 'p', "none");
-
- printf (_(UT_IPv46));
-
- printf (_("\
- -1, --proto1\n\
- tell ssh to use Protocol 1\n\
- -2, --proto2\n\
- tell ssh to use Protocol 2\n\
- -f\n\
- tells ssh to fork rather than create a tty\n"));
-
- printf (_("\
- -C, --command='COMMAND STRING'\n\
- command to execute on the remote machine\n\
- -l, --logname=USERNAME\n\
- SSH user name on remote host [optional]\n\
- -i, --identity=KEYFILE\n\
- identity of an authorized key [optional]\n\
- -O, --output=FILE\n\
- external command file for nagios [optional]\n\
- -s, --services=LIST\n\
- list of nagios service names, separated by ':' [optional]\n\
- -n, --name=NAME\n\
- short name of host in nagios configuration [optional]\n"));
-
- printf (_(UT_WARN_CRIT));
-
- printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
-
- printf (_("\n\
-The most common mode of use is to refer to a local identity file with\n\
-the '-i' option. In this mode, the identity pair should have a null\n\
-passphrase and the public key should be listed in the authorized_keys\n\
-file of the remote host. Usually the key will be restricted to running\n\
-only one command on the remote server. If the remote SSH server tracks\n\
-invocation agruments, the one remote program may be an agent that can\n\
-execute additional commands as proxy\n"));
-
- printf (_("\n\
-To use passive mode, provide multiple '-C' options, and provide\n\
-all of -O, -s, and -n options (servicelist order must match '-C'\n\
-options)\n"));
-}
-
-
-
-
-
-void
-print_usage (void)
-{
- printf (_("Usage:\n\
-check_by_ssh [-f46] [-t timeout] [-i identity] [-l user] -H <host> -C <command>\n\
- [-n name] [-s servicelist] [-O outputfile] [-p port]\n\
-check_by_ssh -V prints version info\n\
-check_by_ssh -h prints more detailed help\n"));
-}
-\f
-
int commands = 0;
int services = 0;
-char *remotecmd = "";
-char *comm = SSH_COMMAND;
+char *remotecmd = NULL;
+char *comm = NULL;
char *hostname = NULL;
char *outputfile = NULL;
char *host_shortname = NULL;
int verbose = FALSE;
+
+
+
+\f
int
main (int argc, char **argv)
{
char input_buffer[MAX_INPUT_BUFFER];
- char *result_text = "";
+ char *result_text;
char *status_text;
- char *output = "";
+ char *output;
char *eol = NULL;
int cresult;
int result = STATE_UNKNOWN;
time_t local_time;
FILE *fp = NULL;
+ asprintf (&remotecmd, "%s", "");
+ asprintf (&comm, "%s", SSH_COMMAND);
/* process arguments */
if (process_arguments (argc, argv) == ERROR)
+\f
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
return OK;
}
+
+
+
+
+
+\f
+void
+print_help (void)
+{
+ print_revision (progname, revision);
+
+ printf (_("Copyright (c) 1999 Karl DeBisschop <kdebisschop@users.sourceforge.net>\n"));
+ printf (_(COPYRIGHT), copyright, email);
+
+ printf (_("This plugin uses SSH to execute commands on a remote host\n\n"));
+
+ print_usage ();
+
+ printf (_(UT_HELP_VRSN));
+
+ printf (_(UT_HOST_PORT), 'p', "none");
+
+ printf (_(UT_IPv46));
+
+ printf (_("\
+ -1, --proto1\n\
+ tell ssh to use Protocol 1\n\
+ -2, --proto2\n\
+ tell ssh to use Protocol 2\n\
+ -f\n\
+ tells ssh to fork rather than create a tty\n"));
+
+ printf (_("\
+ -C, --command='COMMAND STRING'\n\
+ command to execute on the remote machine\n\
+ -l, --logname=USERNAME\n\
+ SSH user name on remote host [optional]\n\
+ -i, --identity=KEYFILE\n\
+ identity of an authorized key [optional]\n\
+ -O, --output=FILE\n\
+ external command file for nagios [optional]\n\
+ -s, --services=LIST\n\
+ list of nagios service names, separated by ':' [optional]\n\
+ -n, --name=NAME\n\
+ short name of host in nagios configuration [optional]\n"));
+
+ printf (_(UT_WARN_CRIT));
+
+ printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
+
+ printf (_("\n\
+The most common mode of use is to refer to a local identity file with\n\
+the '-i' option. In this mode, the identity pair should have a null\n\
+passphrase and the public key should be listed in the authorized_keys\n\
+file of the remote host. Usually the key will be restricted to running\n\
+only one command on the remote server. If the remote SSH server tracks\n\
+invocation agruments, the one remote program may be an agent that can\n\
+execute additional commands as proxy\n"));
+
+ printf (_("\n\
+To use passive mode, provide multiple '-C' options, and provide\n\
+all of -O, -s, and -n options (servicelist order must match '-C'\n\
+options)\n"));
+}
+
+
+
+
+
+void
+print_usage (void)
+{
+ printf (_("\n\
+Usage: %s [-f46] [-t timeout] [-i identity] [-l user] -H <host> \n\
+ -C <command> [-n name] [-s servicelist] [-O outputfile] [-p port]\n"),
+ progname);
+ printf (_(UT_HLP_VRS), progname, progname);
+}
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index b0b0d2a5cf0e58491e9494cd113c5e6d4131d9ae..7feb5a571a85873149825f217d762e96c323018d 100644 (file)
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
# include <limits.h>
#endif
-void
-print_usage (void)
-{
- printf (_("\
-Usage: %s -w limit -c limit [-p path | -x device] [-t timeout] [-m] [-e]\n\
- [-v] [-q]\n\
- %s (-h|--help)\n\
- %s (-V|--version)\n"),
- progname, progname, progname);
-}
-
-void
-print_help (void)
-{
- print_revision (progname, revision);
-
- printf (_(COPYRIGHT), copyright, email);
-
- printf (_("\
-This plugin checks the amount of used disk space on a mounted file system\n\
-and generates an alert if free space is less than one of the threshold values."));
-
- print_usage ();
-
- printf (_(UT_HELP_VRSN));
-
- printf (_("\
- -w, --warning=INTEGER\n\
- Exit with WARNING status if less than INTEGER kilobytes of disk are free\n\
- -w, --warning=PERCENT%%\n\
- Exit with WARNING status if less than PERCENT of disk space is free\n\
- -c, --critical=INTEGER\n\
- Exit with CRITICAL status if less than INTEGER kilobytes of disk are free\n\
- -c, --critical=PERCENT%%\n\
- Exit with CRITCAL status if less than PERCENT of disk space is free\n\
- -C, --clear\n\
- Clear thresholds\n"));
-
- printf (_("\
- -u, --units=STRING\n\
- Choose bytes, kB, MB, GB, TB (default: MB)\n\
- -k, --kilobytes\n\
- Same as '--units kB'\n\
- -m, --megabytes\n\
- Same as '--units MB'\n"));
-
- printf (_("\
- -l, --local\n\
- Only check local filesystems\n\
- -p, --path=PATH, --partition=PARTITION\n\
- Path or partition (may be repeated)\n\
- -x, --exclude_device=PATH <STRING>\n\
- Ignore device (only works if -p unspecified)\n\
- -X, --exclude-type=TYPE <STRING>\n\
- Ignore all filesystems of indicated type (may be repeated)\n\
- -M, --mountpoint\n\
- Display the mountpoint instead of the partition\n\
- -e, --errors-only\n\
- Display only devices/mountpoints with errors\n"));
-
- printf (_(UT_WARN_CRIT));
-
- printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
-
- printf (_(UT_VERBOSE));
-
- printf ("%s", _("Examples:\n\
- check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /\n\
- Checks /tmp and /var at 10%,5% and / at 100MB, 50MB\n"));
-
- support ();
-}
-\f
-
/* If nonzero, show inode information. */
/* static int inode_format; */
{
char *name;
int found;
- int w_df;
- int c_df;
+ uintmax_t w_df;
+ uintmax_t c_df;
double w_dfp;
double c_dfp;
struct name_list *name_next;
#endif
int process_arguments (int, char **);
-int validate_arguments (int, int, double, double, char *);
-int check_disk (int usp, int free_disk);
+void print_path (char *mypath);
+int validate_arguments (uintmax_t, uintmax_t, double, double, char *);
+int check_disk (int usp, uintmax_t free_disk);
int walk_name_list (struct name_list *list, const char *name);
+void print_help (void);
+void print_usage (void);
-int w_df = -1;
-int c_df = -1;
+uintmax_t w_df = 0;
+uintmax_t c_df = 0;
double w_dfp = -1.0;
double c_dfp = -1.0;
char *path = "";
char *exclude_device = "";
-char *units = "MB";
-unsigned long mult = 1024 * 1024;
+char *units = NULL;
+uintmax_t mult = 1024 * 1024;
int verbose = 0;
int erronly = FALSE;
int display_mntp = FALSE;
/* Linked list of mounted filesystems. */
static struct mount_entry *mount_list;
+
+\f
int
main (int argc, char **argv)
{
- int usp = -1;
+ double usp = -1.0;
int result = STATE_UNKNOWN;
int disk_result = STATE_UNKNOWN;
char file_system[MAX_INPUT_BUFFER];
get_fs_usage (me->me_mountdir, me->me_devname, &fsp);
if (fsp.fsu_blocks && strcmp ("none", me->me_mountdir)) {
- usp = (fsp.fsu_blocks - fsp.fsu_bavail) * 100 / fsp.fsu_blocks;
+ usp = (double)(fsp.fsu_blocks - fsp.fsu_bavail) * 100 / fsp.fsu_blocks;
disk_result = check_disk (usp, fsp.fsu_bavail);
result = max_state (disk_result, result);
if (disk_result==STATE_OK && erronly && !verbose)
}
else if (strpbrk (optarg, ",:") &&
strstr (optarg, "%") &&
- sscanf (optarg, "%d%*[:,]%lf%%", &w_df, &w_dfp) == 2) {
+ sscanf (optarg, "%ul%*[:,]%lf%%", &w_df, &w_dfp) == 2) {
break;
}
else if (strstr (optarg, "%") && sscanf (optarg, "%lf%%", &w_dfp) == 1) {
}
else if (strpbrk (optarg, ",:") &&
strstr (optarg, "%") &&
- sscanf (optarg, "%d%*[,:]%lf%%", &c_df, &c_dfp) == 2) {
+ sscanf (optarg, "%ul%*[,:]%lf%%", &c_df, &c_dfp) == 2) {
break;
}
else if (strstr (optarg, "%") && sscanf (optarg, "%lf%%", &c_dfp) == 1) {
}
case 'u':
if (! strcmp (optarg, "bytes")) {
- mult = 1;
+ mult = (uintmax_t)1;
units = "B";
} else if (! strcmp (optarg, "kB")) {
- mult = 1024;
+ mult = (uintmax_t)1024;
units = "kB";
} else if (! strcmp (optarg, "MB")) {
- mult = 1024 * 1024;
+ mult = (uintmax_t)1024 * 1024;
units = "MB";
} else if (! strcmp (optarg, "GB")) {
- mult = 1024 * 1024 * 1024;
+ mult = (uintmax_t)1024 * 1024 * 1024;
units = "GB";
} else if (! strcmp (optarg, "TB")) {
- mult = (unsigned long)1024 * 1024 * 1024 * 1024;
+ mult = (uintmax_t)1024 * 1024 * 1024 * 1024;
units = "TB";
} else {
die (STATE_UNKNOWN, _("unit type %s not known\n"), optarg);
display_mntp = TRUE;
break;
case 'C':
- w_df = -1;
- c_df = -1;
+ w_df = 0;
+ c_df = 0;
w_dfp = -1.0;
c_dfp = -1.0;
break;
/* Support for "check_disk warn crit [fs]" with thresholds at used level */
c = optind;
- if (w_dfp == -1 && argc > c && is_intnonneg (argv[c]))
+ if (w_dfp < 0 && argc > c && is_intnonneg (argv[c]))
w_dfp = (100.0 - atof (argv[c++]));
- if (c_dfp == -1 && argc > c && is_intnonneg (argv[c]))
+ if (c_dfp < 0 && argc > c && is_intnonneg (argv[c]))
c_dfp = (100.0 - atof (argv[c++]));
if (argc > c && strlen (path) == 0) {
}
int
-validate_arguments (int w, int c, double wp, double cp, char *mypath)
+validate_arguments (uintmax_t w, uintmax_t c, double wp, double cp, char *mypath)
{
- if (w < 0 && c < 0 && wp < 0.0 && cp < 0.0) {
+ if (w == 0 && c == 0 && wp < 0.0 && cp < 0.0) {
printf (_("INPUT ERROR: No thresholds specified"));
print_path (mypath);
return ERROR;
@@ -535,10 +466,10 @@ INPUT ERROR: C_DFP (%f) should be less than W_DFP (%.1f) and both should be betw
print_path (path);
return ERROR;
}
- else if ((w > 0 || c > 0) && (w < 0 || c < 0 || c > w)) {
+ else if ((w > 0 || c > 0) && (w == 0 || c == 0 || c > w)) {
printf (_("\
-INPUT ERROR: C_DF (%d) should be less than W_DF (%d) and both should be greater than zero"),
- c, w);
+INPUT ERROR: C_DF (%lu) should be less than W_DF (%lu) and both should be greater than zero"),
+ (unsigned long)c, (unsigned long)w);
print_path (path);
return ERROR;
}
@@ -551,17 +482,17 @@ INPUT ERROR: C_DF (%d) should be less than W_DF (%d) and both should be greater
\f
int
-check_disk (int usp, int free_disk)
+check_disk (int usp, uintmax_t free_disk)
{
int result = STATE_UNKNOWN;
/* check the percent used space against thresholds */
- if (usp >= 0 && usp >= (100.0 - c_dfp))
+ if (usp >= 0.0 && usp >= (100.0 - c_dfp))
result = STATE_CRITICAL;
- else if (c_df >= 0 && free_disk <= c_df)
+ else if (c_df > 0 && free_disk <= c_df)
result = STATE_CRITICAL;
- else if (usp >= 0 && usp >= (100.0 - w_dfp))
+ else if (usp >= 0.0 && usp >= (100.0 - w_dfp))
result = STATE_WARNING;
- else if (w_df >= 0 && free_disk <= w_df)
+ else if (w_df > 0 && free_disk <= w_df)
result = STATE_WARNING;
else if (usp >= 0.0)
result = STATE_OK;
/* if required for name_lists that have not saved w_df, etc (eg exclude lists) */
if (list->w_df) w_df = list->w_df;
if (list->c_df) c_df = list->c_df;
- if (list->w_dfp) w_dfp = list->w_dfp;
- if (list->c_dfp) c_dfp = list->c_dfp;
+ if (list->w_dfp>=0.0) w_dfp = list->w_dfp;
+ if (list->c_dfp>=0.0) c_dfp = list->c_dfp;
return TRUE;
}
list = list->name_next;
}
return FALSE;
}
+
+
+
+
+
+\f
+void
+print_help (void)
+{
+ print_revision (progname, revision);
+
+ printf (_(COPYRIGHT), copyright, email);
+
+ printf (_("\
+This plugin checks the amount of used disk space on a mounted file system\n\
+and generates an alert if free space is less than one of the threshold values."));
+
+ print_usage ();
+
+ printf (_(UT_HELP_VRSN));
+
+ printf (_("\
+ -w, --warning=INTEGER\n\
+ Exit with WARNING status if less than INTEGER kilobytes of disk are free\n\
+ -w, --warning=PERCENT%%\n\
+ Exit with WARNING status if less than PERCENT of disk space is free\n\
+ -c, --critical=INTEGER\n\
+ Exit with CRITICAL status if less than INTEGER kilobytes of disk are free\n\
+ -c, --critical=PERCENT%%\n\
+ Exit with CRITCAL status if less than PERCENT of disk space is free\n\
+ -C, --clear\n\
+ Clear thresholds\n"));
+
+ printf (_("\
+ -u, --units=STRING\n\
+ Choose bytes, kB, MB, GB, TB (default: MB)\n\
+ -k, --kilobytes\n\
+ Same as '--units kB'\n\
+ -m, --megabytes\n\
+ Same as '--units MB'\n"));
+
+ printf (_("\
+ -l, --local\n\
+ Only check local filesystems\n\
+ -p, --path=PATH, --partition=PARTITION\n\
+ Path or partition (may be repeated)\n\
+ -x, --exclude_device=PATH <STRING>\n\
+ Ignore device (only works if -p unspecified)\n\
+ -X, --exclude-type=TYPE <STRING>\n\
+ Ignore all filesystems of indicated type (may be repeated)\n\
+ -M, --mountpoint\n\
+ Display the mountpoint instead of the partition\n\
+ -e, --errors-only\n\
+ Display only devices/mountpoints with errors\n"));
+
+ printf (_(UT_WARN_CRIT));
+
+ printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
+
+ printf (_(UT_VERBOSE));
+
+ printf ("%s", _("Examples:\n\
+ check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /\n\
+ Checks /tmp and /var at 10%,5% and / at 100MB, 50MB\n"));
+
+ support ();
+}
+
+
+
+
+void
+print_usage (void)
+{
+ printf (_("\
+Usage: %s -w limit -c limit [-p path | -x device] [-t timeout] [-m] [-e]\n\
+ [-v] [-q]\n\
+ %s (-h|--help)\n\
+ %s (-V|--version)\n"),
+ progname, progname, progname);
+}
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index 91022bac9a05bf4a398a6fd992b5c93d27f30d32..22e7757d53fe223c925d0ee54b9873db9bf420bf 100644 (file)
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
int process_arguments(int, char **);
void preparelist(char *string);
-int strtoularray(unsigned long *array, char *string, char *delim);
+int strtoularray(unsigned long *array, char *string, const char *delim);
void print_help(void);
void print_usage(void);
else if(vars_to_check==CHECK_CPULOAD){
if (check_value_list==TRUE) {
- if (strtoularray(&lvalue_list,value_list,",")==TRUE) {
+ if (strtoularray(lvalue_list,value_list,",")==TRUE) {
/* -l parameters is present with only integers */
return_code=STATE_OK;
asprintf(&temp_string,_("CPU Load"));
\f
-int strtoularray(unsigned long *array, char *string, char *delim) {
+int strtoularray(unsigned long *array, char *string, const char *delim) {
/* split a <delim> delimited string into a long array */
int idx=0;
char *t1;
diff --git a/plugins/netutils.c b/plugins/netutils.c
index 4ca3168d9553e7767ef893b9aba0ea8769f42a60..92fd14208c7a32b8f031cc03de5014cd7dbb8669 100644 (file)
--- a/plugins/netutils.c
+++ b/plugins/netutils.c
#include "common.h"
#include "netutils.h"
-int socket_timeout = DEFAULT_SOCKET_TIMEOUT;
+unsigned int socket_timeout = DEFAULT_SOCKET_TIMEOUT;
int econn_refuse_state = STATE_CRITICAL;
int was_refused = FALSE;
int address_family = AF_UNSPEC;
else { /* it has */
recv_result =
recv (sd, recv_buffer + recv_length,
- recv_size - recv_length - 1, 0);
+ (size_t)recv_size - recv_length - 1, 0);
if (recv_result == -1) {
/* recv failed, bail out */
strcpy (recv_buffer + recv_length, "");
}
else {
- recv_result = recv (sd, recv_buffer, recv_size - 1, 0);
+ recv_result = recv (sd, recv_buffer, (size_t)recv_size - 1, 0);
if (recv_result == -1) {
strcpy (recv_buffer, "");
if (proto != IPPROTO_TCP)
diff --git a/plugins/netutils.h b/plugins/netutils.h
index 8f534976ea5ff45a2cb4fc4a46412c1c2d2a98be..f5df7af6d45d470614e02111e2238dc187cfe745 100644 (file)
--- a/plugins/netutils.h
+++ b/plugins/netutils.h
#include <netinet/in.h>
#include <arpa/inet.h>
-RETSIGTYPE socket_timeout_alarm_handler (int);
+RETSIGTYPE socket_timeout_alarm_handler (int) __attribute__((noreturn));
int process_tcp_request2 (char *address, int port, char *sbuffer,
char *rbuffer, int rsize);
#endif
int is_hostname (char *);
-extern int socket_timeout;
+extern unsigned int socket_timeout;
extern int econn_refuse_state;
extern int was_refused;
extern int address_family;
diff --git a/plugins/popen.h b/plugins/popen.h
index a1af4be06acc32f7942c5358c777aa983c95e996..b758579249c18c9cc629ac2fa6deaf3762959f12 100644 (file)
--- a/plugins/popen.h
+++ b/plugins/popen.h
int spclose (FILE *);
RETSIGTYPE popen_timeout_alarm_handler (int);
-extern int timeout_interval;
+extern unsigned int timeout_interval;
pid_t *childpid;
int *child_stderr_array;
FILE *child_process;
diff --git a/plugins/utils.h b/plugins/utils.h
index f36834f9cdcefa4590849403716396a4aa633773..9dc2654c51a3e412c6e812da51656a1cd8911a4d 100644 (file)
--- a/plugins/utils.h
+++ b/plugins/utils.h
void support (void);
char *clean_revstring (const char *revstring);
void print_revision (const char *, const char *);
-void die (int result, const char *fmt, ...);
+void die (int result, const char *fmt, ...) __attribute__((noreturn));
/* Handle timeouts */
#ifdef LOCAL_TIMEOUT_ALARM_HANDLER
-extern int timeout_interval;
-RETSIGTYPE timeout_alarm_handler (int);
+extern unsigned int timeout_interval;
+RETSIGTYPE timeout_alarm_handler (int) __attribute__((noreturn));
#else
-int timeout_interval = DEFAULT_SOCKET_TIMEOUT;
-extern RETSIGTYPE timeout_alarm_handler (int);
+unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT;
+extern RETSIGTYPE timeout_alarm_handler (int) __attribute__((noreturn));
#endif
time_t start_time, end_time;
int max_state (int a, int b);
-void usage (char *msg);
-void usage2(char *msg, char *arg);
-void usage3(char *msg, char arg);
+void usage (char *msg) __attribute__((noreturn));
+void usage2(char *msg, char *arg) __attribute__((noreturn));
+void usage3(char *msg, char arg) __attribute__((noreturn));
char *state_text (int result);