]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
portable-util: drop spurious -ENXIO check for xdg_user_config_dir()
authorMike Yuan <me@yhndnzj.com>
Mon, 2 Feb 2026 09:50:40 +0000 (10:50 +0100)
committerMike Yuan <me@yhndnzj.com>
Thu, 5 Feb 2026 13:14:38 +0000 (14:14 +0100)
Unlike $XDG_RUNTIME_DIR the user config dir has a default
value, hence -ENXIO is not really expected.

src/shared/portable-util.c

index 078d311dda64dd9650a07a788c543bc211429208..d2c03aecb91f4762ca9a6c0d53ac5520fc72c362 100644 (file)
@@ -29,13 +29,12 @@ int portable_profile_dirs(RuntimeScope scope, char ***ret) {
                 _cleanup_free_ char *d = NULL;
 
                 r = xdg_user_config_dir("systemd/portable/profile", &d);
-                if (r < 0 && r != -ENXIO)
+                if (r < 0)
+                        return r;
+
+                r = strv_consume(&dirs, TAKE_PTR(d));
+                if (r < 0)
                         return r;
-                if (r >= 0) {
-                        r = strv_consume(&dirs, TAKE_PTR(d));
-                        if (r < 0)
-                                return r;
-                }
 
                 r = xdg_user_runtime_dir("systemd/portable/profile", &d);
                 if (r < 0 && r != -ENXIO)