]> pilppa.org Git - lib1wire.git/blobdiff - src/W1Util.cc
Optimization for year and monthly data calculation.
[lib1wire.git] / src / W1Util.cc
index 452d7290758e7b1eee203e5d27e39c9a03a548a0..a9fc351b9755a28e3cd18c17a94f693127108aea 100644 (file)
@@ -78,9 +78,10 @@ bool W1Util::mkdirs(const char *path) {
                                *p = '\0';
                                // if dir does not exist, create it
                                if (access(path, F_OK) != 0) {
-                                       log_debug("trying to create directory: %s\n", path);
+                                       //log_debug("trying to create directory: %s\n", path);
                                        err_flg = mkdir(path, S_IRWXU);
                                        if (err_flg != 0) {
+                                               log_error("Could not create directory: %s\n", path);
                                                ret_val = false;
                                                break;
                                        }
@@ -91,9 +92,10 @@ bool W1Util::mkdirs(const char *path) {
                if (ret_val == true) {
                        // if dir does not exist, create it
                        if (access(path, F_OK) != 0) {
-                               log_debug("trying to create directory: %s\n", path);
+                               //log_debug("trying to create directory: %s\n", path);
                                err_flg = mkdir(path, S_IRWXU);
                                if (err_flg != 0) {
+                                       log_error("Could not create directory: %s\n", path);
                                        ret_val = false;
                                }
                        }
@@ -229,7 +231,7 @@ vector<string> W1Util::get_subdirectories(const string& path) {
        bool            bool_flg;
        vector<string>  ret_val;
 
-       log_debug("scanning path: %s\n", path.c_str());
+       //log_debug("scanning path: %s\n", path.c_str());
        errno   = 0;
        if (path.empty() == false) {
                dir     = opendir(path.c_str());