Lines Matching defs:dir
10 int safe_mkdir(const char *dir, mode_t mode, uid_t uid, gid_t gid)
15 if (lstat(dir, &st) < 0) {
17 i_fatal("lstat() failed for %s: %m", dir);
19 if (mkdir(dir, mode) < 0) {
21 i_fatal("Can't create directory %s: %m", dir);
30 fd = open(dir, O_RDONLY);
32 i_fatal("open() failed for %s: %m", dir);
35 i_fatal("fstat() failed for %s: %m", dir);
38 i_fatal("Not a directory %s", dir);
45 i_fatal("fchown() failed for %s: %m", dir);
51 i_fatal("chmod() failed for %s: %m", dir);
56 i_fatal("close() failed for %s: %m", dir);
59 if (lstat(dir, &st) < 0)
60 i_fatal("lstat() check failed for %s: %m", dir);
63 i_fatal("Not a directory %s", dir);
67 dir, (int)st.st_mode, (int)mode);
73 dir, dec2str(st.st_uid), dec2str(st.st_gid),