diff options
Diffstat (limited to 'src/libsystemd/sd-id128/id128-util.c')
-rw-r--r-- | src/libsystemd/sd-id128/id128-util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd/sd-id128/id128-util.c b/src/libsystemd/sd-id128/id128-util.c index eae2562410..a27f4bf742 100644 --- a/src/libsystemd/sd-id128/id128-util.c +++ b/src/libsystemd/sd-id128/id128-util.c @@ -102,7 +102,7 @@ int id128_read_fd(int fd, Id128FormatFlag f, sd_id128_t *ret) { } int id128_read(const char *p, Id128FormatFlag f, sd_id128_t *ret) { - _cleanup_close_ int fd = -1; + _cleanup_close_ int fd = -EBADF; fd = open(p, O_RDONLY|O_CLOEXEC|O_NOCTTY); if (fd < 0) @@ -142,7 +142,7 @@ int id128_write_fd(int fd, Id128FormatFlag f, sd_id128_t id) { } int id128_write(const char *p, Id128FormatFlag f, sd_id128_t id) { - _cleanup_close_ int fd = -1; + _cleanup_close_ int fd = -EBADF; fd = open(p, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY|O_TRUNC, 0444); if (fd < 0) |