Code

Removed old terminate function (Bug 1093491)
[nagiosplug.git] / plugins / utils.c
index bb380301a639aa899c228725cbe3cf425b7aae42..b9a19d3fe0c2f8f39d0fd1f5c9bfbd30c1279448 100644 (file)
@@ -53,7 +53,7 @@ max_state (int a, int b)
 
 void usage (const char *msg)
 {
-       printf ("%s", msg);
+       printf ("%s\n", msg);
        print_usage ();
        exit (STATE_UNKNOWN);
 }
@@ -73,17 +73,14 @@ usage3 (const char *msg, int arg)
        exit (STATE_UNKNOWN);
 }
 
-
 void
-support (void)
+usage4 (const char *msg)
 {
-       printf (_("\n\
-Send email to nagios-users@lists.sourceforge.net if you have questions\n\
-regarding use of this software. To submit patches or suggest improvements,\n\
-send email to nagiosplug-devel@lists.sourceforge.net\n"));
+       printf ("%s: %s\n", progname, msg);
+       print_usage();
+       exit (STATE_UNKNOWN);
 }
 
-
 char *
 clean_revstring (const char *revstring)
 {
@@ -103,11 +100,6 @@ print_revision (const char *command_name, const char *revision_string)
                strncpy (plugin_revision, "N/A", STRLEN);
        printf ("%s (%s %s) %s\n",
                                        command_name, PACKAGE, VERSION, plugin_revision);
-       printf (_("\
-The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\n\
-copies of the plugins under the terms of the GNU General Public License.\n\
-For more information about these matters, see the file named COPYING.\n"));
-
 }
 
 const char *
@@ -141,7 +133,7 @@ void
 timeout_alarm_handler (int signo)
 {
        if (signo == SIGALRM) {
-               printf ("CRITICAL - Plugin timed out after %d seconds\n",
+               printf (_("CRITICAL - Plugin timed out after %d seconds\n"),
                                                timeout_interval);
                exit (STATE_CRITICAL);
        }
@@ -315,9 +307,6 @@ strip (char *buffer)
 }
 
 
-
-
-
 /******************************************************************************
  *
  * Copies one string to another. Any previously existing data in
@@ -343,8 +332,6 @@ strscpy (char *dest, const char *src)
 
 
 
-
-
 /******************************************************************************
  *
  * Returns a pointer to the next line of a multiline string buffer
@@ -414,9 +401,6 @@ strnl (char *str)
 }
 
 
-
-
-
 /******************************************************************************
  *
  * Like strscpy, except only the portion of the source string up to
@@ -446,7 +430,7 @@ strpcpy (char *dest, const char *src, const char *str)
        if (dest == NULL || strlen (dest) < len)
                dest = realloc (dest, len + 1);
        if (dest == NULL)
-               die (STATE_UNKNOWN, "failed realloc in strpcpy\n");
+               die (STATE_UNKNOWN, _("failed realloc in strpcpy\n"));
 
        strncpy (dest, src, len);
        dest[len] = '\0';
@@ -456,8 +440,6 @@ strpcpy (char *dest, const char *src, const char *str)
 
 
 
-
-
 /******************************************************************************
  *
  * Like strscat, except only the portion of the source string up to
@@ -490,7 +472,7 @@ strpcat (char *dest, const char *src, const char *str)
 
        dest = realloc (dest, len + l2 + 1);
        if (dest == NULL)
-               die (STATE_UNKNOWN, "failed malloc in strscat\n");
+               die (STATE_UNKNOWN, _("failed malloc in strscat\n"));
 
        strncpy (dest + len, src, l2);
        dest[len + l2] = '\0';
@@ -499,8 +481,6 @@ strpcat (char *dest, const char *src, const char *str)
 }
 
 
-
-
 /******************************************************************************
  *
  * Print perfdata in a standard format