systemd/coccinelle
Zbigniew Jędrzejewski-Szmek 254d1313ae tree-wide: use -EBADF for fd initialization
-1 was used everywhere, but -EBADF or -EBADFD started being used in various
places. Let's make things consistent in the new style.

Note that there are two candidates:
EBADF 9 Bad file descriptor
EBADFD 77 File descriptor in bad state

Since we're initializating the fd, we're just assigning a value that means
"no fd yet", so it's just a bad file descriptor, and the first errno fits
better. If instead we had a valid file descriptor that became invalid because
of some operation or state change, the other errno would fit better.

In some places, initialization is dropped if unnecessary.
2022-12-19 15:00:57 +01:00
..
bool-cast.cocci
close-above-stdio.cocci
cmp.cocci
const-strlen.disabled
debug-logging.cocci
div-round-up.cocci
dup-fcntl.cocci
empty-or-dash.cocci
empty-or-root.cocci
empty-to-null.cocci
empty-to-root.cocci
enotsup.cocci
equals-null.cocci
errno-check.cocci
errno.cocci
exit-0.cocci
flags-set.cocci
fopen-unlocked.cocci
free_and_replace.cocci
hashmap_free.cocci
htonl.cocci
in_set.cocci
iovec-make.cocci
isempty.cocci
log-json.cocci
macros.h treewide: drop "RUN_" from "RUN_WITH_UMASK" 2022-12-13 14:39:30 +01:00
malloc_multiply.cocci
mempcpy.cocci
memzero.cocci
mfree.cocci
mfree_return.cocci
no-if-assignments.cocci
not_in_set.cocci
o-ndelay.cocci
reallocarray.cocci
redundant-if.cocci
run-coccinelle.sh
safe_close-no-if.cocci
safe_close.cocci tree-wide: use -EBADF for fd initialization 2022-12-19 15:00:57 +01:00
safe_closedir.cocci
safe_fclose.cocci
sd_event_source_disable_unref.cocci
set_ensure_put.cocci
strdupa.cocci
strempty.cocci
strjoin.cocci
strjoina.cocci
strv_free.cocci
swap-two.cocci
synthetic-errno.cocci
take-fd.cocci
take-ptr.cocci
timestamp-is-set.cocci
while-true.cocci
xsprintf.cocci
zz-drop-braces.cocci