From: Michael Tremer Date: Fri, 22 Nov 2024 11:50:25 +0000 (+0000) Subject: Revert "pakfire: Ignore if we cannot mount tmpfs" X-Git-Tag: 0.9.30~785 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e3bcc45af85feeaeaef26d11c929d3dad38afdc0;p=pakfire.git Revert "pakfire: Ignore if we cannot mount tmpfs" This reverts commit 5b0ccac2677bfaf1821c13571f68d3191dd10e5b. Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index 4aff554b2..462ecf1ac 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -796,30 +796,6 @@ ERROR: return r; } -static int pakfire_mount_tmpfs(struct pakfire* pakfire, const char* path) { - int r; - - // Mount! - r = mount("pakfire_root", path, "tmpfs", 0, NULL); - if (r) { - switch (errno) { - // We might not have permission to mount tmpfs. Ignore that... - case EPERM: - DEBUG(pakfire->ctx, "We don't have permission to mount tmpfs. Ignoring.\n"); - return 0; - - default: - ERROR(pakfire->ctx, "Could not mount tmpfs: %m\n"); - return -errno; - } - } - - // Umount path later - pakfire->internal_flags |= PAKFIRE_UMOUNT_PATH; - - return 0; -} - PAKFIRE_EXPORT int pakfire_create(struct pakfire** pakfire, struct pakfire_ctx* ctx, const char* path, const char* arch, FILE* conf, int flags) { struct pakfire* p = NULL; @@ -957,9 +933,15 @@ PAKFIRE_EXPORT int pakfire_create(struct pakfire** pakfire, struct pakfire_ctx* // Mount a tmpfs } else { - r = pakfire_mount_tmpfs(p, path); - if (r < 0) + r = mount("pakfire_root", path, "tmpfs", 0, NULL); + if (r) { + ERROR(p->ctx, "Could not mount tmpfs: %m\n"); + r = -errno; goto ERROR; + } + + // Umount path later + p->internal_flags |= PAKFIRE_UMOUNT_PATH; } }