Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1966 - [PATCH] calls close() on the return value of read()
Summary: [PATCH] calls close() on the return value of read()
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: popt
Version: 5.2
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 1999-04-03 20:43 UTC by fortytwo
Modified: 2016-06-03 19:41 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 1999-04-04 16:58:06 UTC

Attachments (Terms of Use)

Description fortytwo 1999-04-03 20:43:10 UTC
I noticed that when I straced rpm it called close(<a large
number>), and that this number had been retuned by read()

This could be a problem if the config file is really short,
or if lots of files are opened.

This patch is against the popt from rpm.

--- popt/poptconfig.c~  Thu Oct  8 07:20:04 1998
+++ popt/poptconfig.c   Sat Mar 13 00:51:23 1999
@@ -83,7 +83,7 @@
     lseek(fd, 0, 0);

     file = alloca(fileLength + 1);
-    if ((fd = read(fd, file, fileLength)) != fileLength) {
+    if (read(fd, file, fileLength) != fileLength) {
        rc = errno;
        errno = rc;

Comment 1 Jeff Johnson 1999-04-04 16:58:59 UTC
Fixed in the popt CVS tree. Thanks for finding.

Comment 2 openshift-github-bot 2016-06-03 19:41:53 UTC
Commit pushed to master at
Merge pull request #1984 from sdodson/issue1966

[WIP] Only run node specific bits on nodes

Note You need to log in before you can comment on or make changes to this bug.