This repository was archived by the owner on Feb 12, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -966,6 +966,7 @@ int path_is_dir(Cstr path)
966966 struct stat statbuf = {0 };
967967 if (stat (path , & statbuf ) < 0 ) {
968968 if (errno == ENOENT ) {
969+ errno = 0 ;
969970 return 0 ;
970971 }
971972
@@ -1024,6 +1025,7 @@ void path_mkdirs(Cstr_Array path)
10241025
10251026 if (mkdir (result , 0755 ) < 0 ) {
10261027 if (errno == EEXIST ) {
1028+ errno = 0 ;
10271029 WARN ("directory %s already exists" , result );
10281030 } else {
10291031 PANIC ("could not create directory %s: %s" , result , strerror (errno ));
@@ -1044,6 +1046,7 @@ void path_rm(Cstr path)
10441046
10451047 if (rmdir (path ) < 0 ) {
10461048 if (errno == ENOENT ) {
1049+ errno = 0 ;
10471050 WARN ("directory %s does not exist" , path );
10481051 } else {
10491052 PANIC ("could not remove directory %s: %s" , path , strerror (errno ));
@@ -1052,6 +1055,7 @@ void path_rm(Cstr path)
10521055 } else {
10531056 if (unlink (path ) < 0 ) {
10541057 if (errno == ENOENT ) {
1058+ errno = 0 ;
10551059 WARN ("file %s does not exist" , path );
10561060 } else {
10571061 PANIC ("could not remove file %s: %s" , path , strerror (errno ));
You can’t perform that action at this time.
0 commit comments