[Nagiosplug-checkins] nagiosplug/contrib check_rbl.c,1.2,1.3

Benoit Mortier opensides at users.sourceforge.net
Wed Dec 1 16:31:05 CET 2004


Update of /cvsroot/nagiosplug/nagiosplug/contrib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16508/contrib

Modified Files:
	check_rbl.c 
Log Message:

adapted for localization



Index: check_rbl.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/contrib/check_rbl.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- check_rbl.c	13 Jan 2003 12:21:51 -0000	1.2
+++ check_rbl.c	2 Dec 2004 00:30:32 -0000	1.3
@@ -22,6 +22,9 @@
 #include "string.h"
 
 const char progname = "check_rbl";
+const char *revision = "$Revision$";
+//const char *copyright = "2000-2003";
+//const char *email = "nagiosplug-devel at lists.sourceforge.net";
 
 int process_arguments(int, char **);
 int call_getopt(int, char **);
@@ -48,7 +51,7 @@
 		usage("Cannot catch SIGALRM\n");
 
 	if (process_arguments(argc,argv)!=OK)
-		usage("Could not parse arguments\n");
+		usage	(_("check_rbl: could not parse arguments\n"));
 
 	/* reverse the octets in the IP address */
 	query_address_rev = reverse_ipaddr(query_address);
@@ -127,7 +130,7 @@
 	if (spclose(child_process)) {
 		result=error_set(result,STATE_WARNING);
 		if (!strcmp(output,""))
-			strcpy(output,"nslookup returned error status");
+			strcpy(output,"nslookup returned an error status");
 	}
 	
 	(void)time(&end_time);
@@ -144,6 +147,8 @@
 	return result;
 }
 
+
+
 /* reverse the ipaddr */
 char *reverse_ipaddr(char *ipaddr)
 {
@@ -160,6 +165,7 @@
 }
 
 
+
 /* process command-line arguments */
 int process_arguments(int argc, char **argv)
 {
@@ -189,9 +195,6 @@
 
 
 
-
-
-
 int call_getopt(int argc, char **argv)
 {
   int c,i=0;
@@ -266,7 +269,9 @@
 				print_help();
 				exit(STATE_OK);
       case '?': /* help */
-				usage("Invalid argument\n");
+			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+			print_usage ();
+			exit (STATE_UNKNOWN);
 			}
   }
   return i;
@@ -274,8 +279,6 @@
 
 
 
-
-
 int validate_arguments(void)
 {
   if (query_address == NULL || rbl_name == NULL)
@@ -286,8 +289,6 @@
 
 
 
-
-
 void print_help(void)
 {
 	print_revision(progname,"$Revision$");
@@ -317,8 +318,6 @@
 
 
 
-
-
 void print_usage(void)
 {
 	printf





More information about the Commits mailing list