gentoo-ebuilds/sys-fs/udisks/files/udisks-2.10.1-udiskslinuxblock_survive_missing_fstab.patch
Pacho Ramos 379060f482
sys-fs/udisks: Multiple bugfixes from upstream
Signed-off-by: Pacho Ramos <pacho@gentoo.org>
2024-09-15 14:24:58 +02:00

32 lines
1,023 B
Diff

From 8f62f7c6888659f3b66d5861d46fb9b3a34ff169 Mon Sep 17 00:00:00 2001
From: Marius Vollmer <mvollmer@redhat.com>
Date: Thu, 22 Feb 2024 16:49:24 +0200
Subject: [PATCH] udiskslinuxblock: Survive a missing /etc/fstab
This is similar to b79f6840ca82551e672156153b7e13328f0ba19d, which
solved the same problem for /etc/crypttab.
---
src/udiskslinuxblock.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c
index 829dd5f78..a3fa183be 100644
--- a/src/udiskslinuxblock.c
+++ b/src/udiskslinuxblock.c
@@ -1541,7 +1541,15 @@ add_remove_fstab_entry (UDisksBlock *block,
&contents,
NULL,
error))
- goto out;
+ {
+ if (g_error_matches (*error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
+ {
+ contents = g_strdup ("");
+ g_clear_error (error);
+ }
+ else
+ goto out;
+ }
lines = g_strsplit (contents, "\n", 0);