From: Zbigniew Jędrzejewski-Szmek Date: Mon, 19 Dec 2022 12:11:05 +0000 (+0100) Subject: tree-wide: change initialization to use EBADF instead of EBADFD X-Git-Tag: v253-rc1~241^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5937dcf3902ecb90777f259f6e006292eb54251;p=thirdparty%2Fsystemd.git tree-wide: change initialization to use EBADF instead of EBADFD Those fds never were, so it's not fair to say that they are in "bad state". Let's use the shorter and more direct errno. --- diff --git a/src/basic/env-file.c b/src/basic/env-file.c index 5a4b21ee6aa..45b0d901c54 100644 --- a/src/basic/env-file.c +++ b/src/basic/env-file.c @@ -381,7 +381,7 @@ int parse_env_file_fd_sentinel( const char *fname, /* only used for logging */ ...) { - _cleanup_close_ int fd_ro = -EBADFD; + _cleanup_close_ int fd_ro = -EBADF; _cleanup_fclose_ FILE *f = NULL; va_list ap; int r; diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c index 693e1f7eb62..700e28f2c2d 100644 --- a/src/basic/stat-util.c +++ b/src/basic/stat-util.c @@ -183,7 +183,7 @@ static int fd_is_read_only_fs(int fd) { } int path_is_read_only_fs(const char *path) { - _cleanup_close_ int fd = -EBADFD; + _cleanup_close_ int fd = -EBADF; assert(path); diff --git a/src/locale/localed-util.c b/src/locale/localed-util.c index cace820bddb..ddca11d908e 100644 --- a/src/locale/localed-util.c +++ b/src/locale/localed-util.c @@ -93,7 +93,7 @@ int locale_read_data(Context *c, sd_bus_message *m) { } int vconsole_read_data(Context *c, sd_bus_message *m) { - _cleanup_close_ int fd = -EBADFD; + _cleanup_close_ int fd = -EBADF; struct stat st; /* Do not try to re-read the file within single bus operation. */ @@ -130,7 +130,7 @@ int vconsole_read_data(Context *c, sd_bus_message *m) { } int x11_read_data(Context *c, sd_bus_message *m) { - _cleanup_close_ int fd = -EBADFD, fd_ro = -EBADFD; + _cleanup_close_ int fd = -EBADF, fd_ro = -EBADF; _cleanup_fclose_ FILE *f = NULL; bool in_section = false; struct stat st; diff --git a/src/shared/locale-setup.c b/src/shared/locale-setup.c index 64af9d57b8f..8943a42c9d3 100644 --- a/src/shared/locale-setup.c +++ b/src/shared/locale-setup.c @@ -55,7 +55,7 @@ static int locale_context_load_proc(LocaleContext *c, LocaleLoadFlag flag) { } static int locale_context_load_conf(LocaleContext *c, LocaleLoadFlag flag) { - _cleanup_close_ int fd = -EBADFD; + _cleanup_close_ int fd = -EBADF; struct stat st; int r;