From: Christian Brauner Date: Sun, 15 Mar 2020 01:40:13 +0000 (+0100) Subject: tree-wide: remove last -1 fd initialization with cleanup macros in favor of -EBADF X-Git-Tag: lxc-4.0.0~30^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3294%2Fhead;p=thirdparty%2Flxc.git tree-wide: remove last -1 fd initialization with cleanup macros in favor of -EBADF Signed-off-by: Christian Brauner --- diff --git a/src/lxc/attach.c b/src/lxc/attach.c index d9da4ad81..083f709bb 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -131,7 +131,7 @@ static void lxc_proc_put_context_info(struct lxc_proc_context_info *ctx) */ static int in_same_namespace(pid_t pid1, pid_t pid2, const char *ns) { - __do_close int ns_fd1 = -1, ns_fd2 = -1; + __do_close int ns_fd1 = -EBADF, ns_fd2 = -EBADF; int ret = -1; struct stat ns_st1, ns_st2; diff --git a/src/lxc/uuid.c b/src/lxc/uuid.c index 414a00341..a5d24bbcb 100644 --- a/src/lxc/uuid.c +++ b/src/lxc/uuid.c @@ -39,7 +39,7 @@ static lxc_id128_t make_v4_uuid(lxc_id128_t id) static int get_random_bytes(void *p, size_t n) { - __do_close int fd = -1; + __do_close int fd = -EBADF; ssize_t bytes = 0; fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC | O_NOCTTY);