]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: avoid static analysis failure for ignored dup2 return
authorPádraig Brady <P@draigBrady.com>
Sat, 8 Jul 2023 12:42:51 +0000 (13:42 +0100)
committerPádraig Brady <P@draigBrady.com>
Sat, 8 Jul 2023 12:42:51 +0000 (13:42 +0100)
* src/sort.c: We're ignoring failures from these calls,
so do so explicitly to avoid static analysis issues
as reported by coverity.

src/sort.c

index a7002d170b4a47cf580f0451547d0dcd86e7965b..06884dff3558e48d633a8e1f46c3f0fef3973f89 100644 (file)
@@ -1025,9 +1025,9 @@ move_fd (int oldfd, int newfd)
 {
   if (oldfd != newfd)
     {
-      /* This should never fail for our usage.  */
-      dup2 (oldfd, newfd);
-      close (oldfd);
+      /* These should never fail for our usage.  */
+      ignore_value (dup2 (oldfd, newfd));
+      ignore_value (close (oldfd));
     }
 }