diff options
Diffstat (limited to 'lib/xwrap.c')
-rw-r--r-- | lib/xwrap.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c index 2ecffaad..51bd2b43 100644 --- a/lib/xwrap.c +++ b/lib/xwrap.c @@ -369,34 +369,6 @@ void xchroot(char *path) xchdir("/"); } -// Ensure entire path exists. -// If mode != -1 set permissions on newly created dirs. -// Requires that path string be writable (for temporary null terminators). -void xmkpath(char *path, int mode) -{ - char *p, old; - mode_t mask; - int rc; - struct stat st; - - for (p = path; ; p++) { - if (!*p || *p == '/') { - old = *p; - *p = rc = 0; - if (stat(path, &st) || !S_ISDIR(st.st_mode)) { - if (mode != -1) { - mask=umask(0); - rc = mkdir(path, mode); - umask(mask); - } else rc = mkdir(path, 0777); - } - *p = old; - if(rc) perror_exit("mkpath '%s'", path); - } - if (!*p) break; - } -} - struct passwd *xgetpwuid(uid_t uid) { struct passwd *pwd = getpwuid(uid); |