]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
elf: should check result of openat with -1 not 1
authorWeixie Cui <cuiweixie@gmail.com>
Fri, 27 Feb 2026 11:40:58 +0000 (19:40 +0800)
committerYury Khrustalev <yury.khrustalev@arm.com>
Mon, 9 Mar 2026 09:46:11 +0000 (09:46 +0000)
Signed-off-by: Weixie Cui <cuiweixie@gmail.com>
Reviewed-by: Yury Khrustalev <yury.khrustalev@arm.com>
elf/pldd.c

index b9e20aa6faa1a273ad57281e83465dce5a8c6f9b..62e660c3f8c9793e5a3982a44dfa581b933e732a 100644 (file)
@@ -137,7 +137,7 @@ main (int argc, char *argv[])
   } *thread_list = NULL;
 
   int taskfd = openat (dfd, "task", O_RDONLY | O_DIRECTORY | O_CLOEXEC);
-  if (taskfd == 1)
+  if (taskfd == -1)
     error (EXIT_FAILURE, errno, gettext ("cannot open %s/task"), buf);
   DIR *dir = fdopendir (taskfd);
   if (dir == NULL)