Bug 1966

Summary: [PATCH] calls close() on the return value of read()
Product: [Retired] Red Hat Linux Reporter: fortytwo
Component: poptAssignee: Jeff Johnson <jbj>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 5.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-04-04 16:58:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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()
previously.

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;
        close(fd);
        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 https://github.com/openshift/openshift-ansible

https://github.com/openshift/openshift-ansible/commit/6fb6e059dc50fcdc2480c06cfcf0a45674283725
Merge pull request #1984 from sdodson/issue1966

[WIP] Only run node specific bits on nodes