]> Zhao Yanbai Git Server - minix.git/commitdiff
Decrease verbosity of devmand.
authorKees Jongenburger <kees.jongenburger@gmail.com>
Tue, 19 Jun 2012 10:14:14 +0000 (10:14 +0000)
committerKees Jongenburger <kees.jongenburger@gmail.com>
Tue, 19 Jun 2012 14:30:02 +0000 (16:30 +0200)
Display warnings(non critical errors) only when the verbose flag
is set.

commands/devmand/main.c

index 6359cd03e28547adf30314b60f37054f6b126ef9..f53fe58ed30599d7fb3c2f4b54a88af9debf3c77 100644 (file)
@@ -329,21 +329,20 @@ static void parse_config()
                status = stat(dirname,&stats);
                if (status == -1){
                        error = errno;
-                       fprintf(stderr,"Failed to read directory '%s':%s"
-                               " (skipping) \n", dirname,strerror(error));
+                       dbg("Failed to read directory '%s':%s (skipping) \n", 
+                           dirname,strerror(error));
                        continue;
                }
                if (!S_ISDIR(stats.st_mode)){
-                       fprintf(stderr,"Parse configuration skipping %s" 
-                               " (not a directory) \n",dirname);
+                       dbg("Parse configuration skipping %s "
+                           "(not a directory) \n",dirname);
                        continue;
                }
                dir = opendir(dirname);
                if (dir == NULL){
                        error = errno;
-                       fprintf(stderr,"Parse configuration failed to read" 
-                               " dir '%s' (skipping) :%s\n",dirname, 
-                               strerror(error));
+                       dbg("Parse configuration failed to read dir '%s'"
+                           "(skipping) :%s\n",dirname, strerror(error));
                        continue;
                }
                while( (status = readdir_r(dir,&entry,&result)) == 0 ){
@@ -358,16 +357,16 @@ static void parse_config()
                        status = stat(config_file, &stats);
                        if (status == -1){ 
                                error = errno;
-                               fprintf(stderr,"Parse configuration Failed to stat" 
-                                       " file '%s': %s (skipping)\n",
-                                             config_file,strerror(error));
+                               dbg("Parse configuration Failed to stat file "
+                                   "'%s': %s (skipping)\n", config_file,
+                                   strerror(error));
                        }
                        if (S_ISREG(stats.st_mode)){
                                dbg("Parsing file %s",config_file);
                                yyin = fopen(config_file, "r");
 
                                if (yyin < 0) {
-                                       printf("Can not open config file:" 
+                                       dbg("Can not open config file:" 
                                               " %d.\n", errno);
                                }
                                yyparse();