Repositories / jai.git
jai.git
Clone (read-only): git clone http://git.guha-anderson.com/git/jai.git
@@ -205,17 +205,17 @@ ensure_dir(int dfd, const path &p, mode_t perm, FollowLinks follow, } else if (errno != ENOENT) syserr(R"(ensure_dir("{}"): open("{}"))", p.string(), - component->string()); + fdpath(dfd, *component)); + else if (mkdirat(dfd, component->c_str(), perm) && errno != EEXIST) + syserr(R"(ensure_dir("{}"): mkdir("{}"))", p.string(), + fdpath(dfd, *component)); else if (struct stat sb; fstatat(dfd, component->c_str(), &sb, 0)) syserr(R"(ensure_dir("{}"): stat("{}"))", p.string(), - component->string()); + fdpath(dfd, *component)); else if (!S_ISDIR(sb.st_mode)) { syserr(R"(ensure_dir("{}"): "{}" is not a directory)", p.string(), - component->string()); + fdpath(dfd, *component)); } - else if (mkdirat(dfd, component->c_str(), perm) && errno != EEXIST) - syserr(R"(ensure_dir("{}"): mkdir("{}"))", p.string(), - component->string()); // Don't advance iterator; want to open directory we just created }