Bug 1966 - [PATCH] calls close() on the return value of read()
Summary: [PATCH] calls close() on the return value of read()
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: popt
Version: 5.2
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
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:
Clone Of:
Environment:
Last Closed: 1999-04-04 16:58:06 UTC
Embargoed:


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


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