Browse Source

- print warnings number if any

Andrei Pelinescu-Onciul 19 years ago
parent
commit
bb8e2a3579
4 changed files with 7 additions and 2 deletions
  1. 1 1
      Makefile.defs
  2. 1 1
      cfg.y
  3. 1 0
      globals.h
  4. 4 0
      main.c

+ 1 - 1
Makefile.defs

@@ -59,7 +59,7 @@ MAIN_NAME=ser
 VERSION = 0
 VERSION = 0
 PATCHLEVEL = 9
 PATCHLEVEL = 9
 SUBLEVEL = 7
 SUBLEVEL = 7
-EXTRAVERSION = -pre5
+EXTRAVERSION = -pre6
 
 
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")

+ 1 - 1
cfg.y

@@ -1680,7 +1680,7 @@ static void warn(char* s)
 {
 {
 	LOG(L_WARN, "cfg. warning: (%d,%d-%d): %s\n", line, startcolumn, 
 	LOG(L_WARN, "cfg. warning: (%d,%d-%d): %s\n", line, startcolumn, 
 			column, s);
 			column, s);
-	cfg_errors++;
+	cfg_warnings++;
 }
 }
 
 
 static void yyerror(char* s)
 static void yyerror(char* s)

+ 1 - 0
globals.h

@@ -114,6 +114,7 @@ extern int mcast_ttl;
 /* extern int *pids; -moved to pt.h */
 /* extern int *pids; -moved to pt.h */
 
 
 extern int cfg_errors;
 extern int cfg_errors;
+extern int cfg_warnings;
 extern unsigned int msg_no;
 extern unsigned int msg_no;
 
 
 extern unsigned long shm_mem_size;
 extern unsigned long shm_mem_size;

+ 4 - 0
main.c

@@ -324,6 +324,7 @@ int process_no = 0;
 
 
 /* cfg parsing */
 /* cfg parsing */
 int cfg_errors=0;
 int cfg_errors=0;
+int cfg_warnings=0;
 
 
 /* shared memory (in MB) */
 /* shared memory (in MB) */
 unsigned long shm_mem_size=SHM_MEM_SIZE * 1024 * 1024;
 unsigned long shm_mem_size=SHM_MEM_SIZE * 1024 * 1024;
@@ -1436,6 +1437,9 @@ try_again:
 		fprintf(stderr, "ERROR: bad config file (%d errors)\n", cfg_errors);
 		fprintf(stderr, "ERROR: bad config file (%d errors)\n", cfg_errors);
 		goto error;
 		goto error;
 	}
 	}
+	if (cfg_warnings){
+		fprintf(stderr, "%d config warnings\n", cfg_warnings);
+	}