return 0;
}
+char* namespace_cleanup_tmpdir(char *p) {
+ if (!p)
+ return NULL;
+
+ if (!streq(p, RUN_SYSTEMD_EMPTY)) {
+ _cleanup_free_ char *child = path_join(p, "tmp");
+ if (!child)
+ log_oom_debug();
+ else
+ (void) rmdir(child);
+
+ (void) rmdir(p);
+ }
+
+ return mfree(p);
+}
+
static int make_tmp_prefix(const char *prefix) {
_cleanup_free_ char *t = NULL;
_cleanup_close_ int fd = -EBADF;
return 0;
}
-char* namespace_cleanup_tmpdir(char *p) {
- PROTECT_ERRNO;
- if (!streq_ptr(p, RUN_SYSTEMD_EMPTY))
- (void) rmdir(p);
- return mfree(p);
-}
-
int setup_tmp_dirs(const char *id, char **tmp_dir, char **var_tmp_dir) {
_cleanup_(namespace_cleanup_tmpdirp) char *a = NULL;
_cleanup_(rmdir_and_freep) char *a_tmp = NULL;