Code

Fix includes for gettext
[nagiosplug.git] / plugins / check_smtp.c
index c0ddc70326231fd23eb6b42207354b52b63ca7de..b6c60c244ebf5ea73446fc28ca8a0a017e3fb3f4 100644 (file)
@@ -88,7 +88,7 @@ main (int argc, char **argv)
        bindtextdomain (PACKAGE, LOCALEDIR);
        textdomain (PACKAGE);
 
-       if (process_arguments (argc, argv) != TRUE)
+       if (process_arguments (argc, argv) == ERROR)
                usage4 (_("Could not parse arguments"));
 
        /* initialize the HELO command with the localhostname */
@@ -218,11 +218,12 @@ main (int argc, char **argv)
        microsec = deltime (tv);
        elapsed_time = (double)microsec / 1.0e6;
 
-       if (result == STATE_OK)
+       if (result == STATE_OK) {
                if (check_critical_time && elapsed_time > (double) critical_time)
                        result = STATE_CRITICAL;
                else if (check_warning_time && elapsed_time > (double) warning_time)
                        result = STATE_WARNING;
+       }
 
        printf (_("SMTP %s - %.3f sec. response time%s%s|%s\n"),
                state_text (result), elapsed_time,
@@ -295,7 +296,7 @@ process_arguments (int argc, char **argv)
                        if (is_intpos (optarg))
                                server_port = atoi (optarg);
                        else
-                               usage (_("Port must be a positive integer\n"));
+                               usage4 (_("Port must be a positive integer"));
                        break;
                case 'f':                                                                       /* from argument */
                        from_arg = optarg;
@@ -330,7 +331,7 @@ process_arguments (int argc, char **argv)
                                check_critical_time = TRUE;
                        }
                        else {
-                               usage (_("Critical time must be a positive integer\n"));
+                               usage4 (_("Critical time must be a positive integer"));
                        }
                        break;
                case 'w':                                                                       /* warning time threshold */
@@ -339,7 +340,7 @@ process_arguments (int argc, char **argv)
                                check_warning_time = TRUE;
                        }
                        else {
-                               usage (_("Warning time must be a positive integer\n"));
+                               usage4 (_("Warning time must be a positive integer"));
                        }
                        break;
                case 'v':                                                                       /* verbose */
@@ -350,7 +351,7 @@ process_arguments (int argc, char **argv)
                                socket_timeout = atoi (optarg);
                        }
                        else {
-                               usage (_("Time interval must be a positive integer\n"));
+                               usage4 (_("Time interval must be a positive integer"));
                        }
                        break;
                case '4':
@@ -360,7 +361,7 @@ process_arguments (int argc, char **argv)
 #ifdef USE_IPV6
                        address_family = AF_INET6;
 #else
-                       usage (_("IPv6 support not available\n"));
+                       usage4 (_("IPv6 support not available"));
 #endif
                        break;
                case 'V':                                                                       /* version */
@@ -422,8 +423,7 @@ print_help (void)
        printf ("Copyright (c) 1999-2001 Ethan Galstad <nagios@nagios.org>\n");
        printf (COPYRIGHT, copyright, email);
 
-       printf(_("\
-This plugin will attempt to open an SMTP connection with the host.\n\n"));
+       printf(_("This plugin will attempt to open an SMTP connection with the host.\n\n"));
 
        print_usage ();
 
@@ -468,6 +468,5 @@ print_usage (void)
 {
        printf ("\
 Usage: %s -H host [-p port] [-e expect] [-C command] [-f from addr]\n\
-  [-w warn] [-c crit] [-t timeout] [-n] [-v] [-4|-6]\n", progname);
-       printf (_(UT_HLP_VRS), progname, progname);
+                  [-w warn] [-c crit] [-t timeout] [-n] [-v] [-4|-6]\n", progname);
 }