Bug 1966 - [PATCH] calls close() on the return value of read()
[PATCH] calls close() on the return value of read()
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: popt (Show other bugs)
5.2
All Linux
medium Severity low
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-04-03 15:43 EST by fortytwo
Modified: 2016-06-03 15:41 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-04-04 12:58:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description fortytwo 1999-04-03 15:43:10 EST
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 12:58:59 EDT
Fixed in the popt CVS tree. Thanks for finding.
Comment 2 openshift-github-bot 2016-06-03 15:41:53 EDT
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

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