diff options
author | Inga Stotland <inga.stotland@intel.com> | 2021-11-30 15:14:12 -0800 |
---|---|---|
committer | Brian Gix <brian.gix@intel.com> | 2021-12-06 10:19:07 -0800 |
commit | 1f380468ce06e22ea66e12f5d681f7e21044b12f (patch) | |
tree | 359e824619244ecb928e228a1db982f27e8f93bf /mesh/util.c | |
parent | aa361e22164aeb8a161a75e7704ea265eeae7472 (diff) | |
download | bluez-1f380468ce06e22ea66e12f5d681f7e21044b12f.tar.gz |
mesh: Don't log error for false positive mkdir failure
When invoking mkdir() for mesh configuration storage, do not
report an error if a target directory already exists.
Diffstat (limited to 'mesh/util.c')
-rw-r--r-- | mesh/util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesh/util.c b/mesh/util.c index d505e7a0c..82b57f642 100644 --- a/mesh/util.c +++ b/mesh/util.c @@ -118,13 +118,13 @@ int create_dir(const char *dir_name) } strncat(dir, prev + 1, next - prev); - if (mkdir(dir, 0755) != 0) + if (mkdir(dir, 0755) != 0 && errno != EEXIST) l_error("Failed to create dir(%d): %s", errno, dir); prev = next; } - if (mkdir(dir_name, 0755) != 0) + if (mkdir(dir_name, 0755) != 0 && errno != EEXIST) l_error("Failed to create dir(%d): %s", errno, dir_name); return 0; |