Don't close the credits buffer file descriptor too early
authorOndřej Surý <ondrej@sury.org>
Tue, 22 Jun 2021 13:48:57 +0000 (15:48 +0200)
committerOndřej Surý <ondrej@debian.org>
Fri, 30 Aug 2024 09:13:51 +0000 (11:13 +0200)
Gbp-Pq: Name 0040-Don-t-close-the-credits-buffer-file-descriptor-too-e.patch

ext/standard/credits.c

index 8ea0f5b9a3d70ee75de69d49aefa07e9ffc7e5f4..1103bea2e018549bcf945d59746af16ce6b45c9f 100644 (file)
@@ -216,7 +216,6 @@ PHPAPI void php_print_packaging_credits(int flag, int top) /* {{{ */
 
                        if (fd > 0) {
                                bytes = read(fd, buf, sizeof(buf) - 1);
-                               close(fd);
                        }
 
                        if (bytes > 0) {
@@ -270,6 +269,9 @@ PHPAPI void php_print_packaging_credits(int flag, int top) /* {{{ */
                                                 "DEB.SURY.ORG <https://deb.sury.org/>.");
                                }
                        }
+                       if (fd > 0) {
+                               close(fd);
+                       }
                        php_info_print_table_end();
                        break;
                case DEBIAN: