1
0
mirror of https://github.com/systemd/systemd synced 2024-07-09 04:26:06 +00:00
Commit Graph

3 Commits

Author SHA1 Message Date
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
Zbigniew Jędrzejewski-Szmek
64b92d637c licensing: add spdx to our .cocci files
Since those are chunks of code based on our codebase, it's easiest to use the
same license.
2021-10-01 14:45:00 +02:00
Lennart Poettering
66e405837b tree-wide: make more code use safe_close()
Replace this:

        close(fd);
        fd = -1;

write this:

        fd = safe_close(fd);
2015-09-09 08:20:19 +02:00