]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tree-wide: remove last -1 fd initialization with cleanup macros in favor of -EBADF 3294/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 15 Mar 2020 01:40:13 +0000 (02:40 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 15 Mar 2020 01:40:13 +0000 (02:40 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/attach.c
src/lxc/uuid.c

index d9da4ad81e03c6b9dcd9dfd764aa2f200cd22109..083f709bb5796e5d3c7e930f669e17fca2a28ded 100644 (file)
@@ -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;
 
index 414a00341412285c8dd1caa5e12cd05351ff6dbb..a5d24bbcba424ff0dd7868e788f3d59bd850b7ab 100644 (file)
@@ -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);