First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 77367
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo's Team for Core System packages <base-system@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Robert Wolf <gentoo@slave.umbr.cas.cz>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 77367 depends on: Show dependency tree
Show dependency graph
Bug 77367 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-01-10 06:10 0000
I have ed-0.2-r5 installed on my Gentoo and if I try to run ed, it fails to
start with "/tmp/ed.kyBTZg: Bad file descriptor" error.

Reproducible: Always
Steps to Reproduce:
1.emerge =sys-apps/ed-0.2-r5
2.run ed
Actual Results:  
"Bad file descriptor" error.

Expected Results:  
Start ed

IMHO the problem is in 0.2-mkstemp.patch file, where is the code:

 sfd = mkstemp(sfn);
   if ((sfd == -1) || (sfp = fdopen (sfn, "w+")) == NULL)

but there should be 

   if ((sfd == -1) && (sfp = fdopen (sfn, "w+")) == NULL)

The fdopen should be run only if the mkstemp fails. But in present version it's
called everytime and it fails, because mkstemp opens file with O_EXCL flag
which
means no one other can open the file.

------- Comment #1 From Carsten Lohrke 2005-01-10 06:28:46 0000 -------
indeed

------- Comment #2 From SpanKY 2005-01-10 09:10:33 0000 -------
no, that's not how fdopen() works

the problem is that the parameter to fdopen is still wrong, it should be sfd

fixed in 0.2-r6

------- Comment #3 From SpanKY 2005-01-10 10:34:03 0000 -------
*** Bug 77351 has been marked as a duplicate of this bug. ***

------- Comment #4 From Carsten Lohrke 2005-01-10 11:51:07 0000 -------
*** Bug 77383 has been marked as a duplicate of this bug. ***

------- Comment #5 From Carsten Lohrke 2005-01-10 11:56:11 0000 -------
*** Bug 77393 has been marked as a duplicate of this bug. ***

------- Comment #6 From Robin Johnson 2005-01-15 19:48:29 0000 -------
*** Bug 78120 has been marked as a duplicate of this bug. ***

First Last Prev Next    No search results available      Search page      Enter new bug