]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
discover-image: use _SD_PATH_INVALID where appropriate
authorLennart Poettering <lennart@poettering.net>
Tue, 18 Nov 2025 21:32:41 +0000 (22:32 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 24 Nov 2025 17:42:04 +0000 (17:42 +0000)
The enum definition only exists for cases like this, use it, instead of
its literal value.

This doesn't effectively change anything, but cleans up the code a bit.

src/shared/discover-image.c

index 4e26b287c2c9e18713613c23b662c0911c0160d3..3c952ba369624b8075dc183013b2a8fe469fba01 100644 (file)
@@ -171,13 +171,13 @@ static char** image_settings_path(Image *image, RuntimeScope scope) {
                 SD_PATH_SYSTEM_CONFIGURATION,
                 SD_PATH_SYSTEM_RUNTIME,
                 SD_PATH_SYSTEM_LIBRARY_PRIVATE,
-                UINT64_MAX
+                _SD_PATH_INVALID
         };
         static const uint64_t user_locations[] = {
                 SD_PATH_USER_CONFIGURATION,
                 SD_PATH_USER_RUNTIME,
                 SD_PATH_USER_LIBRARY_PRIVATE,
-                UINT64_MAX
+                _SD_PATH_INVALID
         };
         const uint64_t *locations;
 
@@ -194,7 +194,7 @@ static char** image_settings_path(Image *image, RuntimeScope scope) {
                 assert_not_reached();
         }
 
-        for (size_t k = 0; locations[k] != UINT64_MAX; k++) {
+        for (size_t k = 0; locations[k] != _SD_PATH_INVALID; k++) {
                 _cleanup_free_ char *s = NULL;
                 r = sd_path_lookup(locations[k], "systemd/nspawn", &s);
                 if (r == -ENXIO)