File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -69,18 +69,15 @@ get_cache_file() {
6969 return " " ;
7070 }
7171
72- struct stat cache_dir_stat;
73- if (-1 == stat (cache_dir.c_str (), &cache_dir_stat)) {
74- if (errno == ENOENT) {
75- if (-1 == mkdir (cache_dir.c_str (), 0700 )) return " " ;
76- }
72+ int r = mkdir (cache_dir.c_str (), 0700 );
73+ if ((r < 0 ) && errno != EEXIST) {
74+ return " " ;
7775 }
7876
7977 std::string keycache_dir = cache_dir + " /scitokens" ;
80- if (-1 == stat (keycache_dir.c_str (), &cache_dir_stat)) {
81- if (errno == ENOENT) {
82- if (-1 == mkdir (keycache_dir.c_str (), 0700 )) return " " ;
83- }
78+ r = mkdir (keycache_dir.c_str (), 0700 );
79+ if ((r < 0 ) && errno != EEXIST) {
80+ return " " ;
8481 }
8582
8683 std::string keycache_file = keycache_dir + " /scitokens_cpp.sqllite" ;
You can’t perform that action at this time.
0 commit comments