Simplify make_directories API

* src/extract.c (make_directories): Return a 3-way int rather than
an int (actually a bool) and another optional bool via a pointer.
All callers changed.  In comment, make it clearer what the
return value means.  Also, improve behavior in a small way: when
issuing a diagnostic on MS-Windows-like systems, use the original
directory name rather than translating '\\' to '/'.
This commit is contained in:
Paul Eggert
2026-07-29 23:12:46 -07:00
parent d405469bf4
commit 4dc85c626f
3 changed files with 24 additions and 20 deletions
+1 -1
View File
@@ -1139,7 +1139,7 @@ chdir_do (idx_t i, bool create)
namebuf_add_dir (nbuf, ".");
dir_with_dot = namebuf_finish (nbuf);
}
if (make_directories (dir_with_dot, NULL) == 0)
if (0 <= make_directories (dir_with_dot))
/* Directory created, retry */
fd = openat (chdir_fd, curr->name,
open_searchdir_how.flags & ~O_NOFOLLOW);