Bug #72
_tx_error needs to preserve the errno value it is supposed to display
Added by John Doe over 10 years ago.
Updated over 8 years ago.
Category:
lib - userland libraries
Description
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=5054112
Fix is attached. Still need review.
[dep, 27May2004]
_tx_error, called by t_error, is supposed to display a message,
followed by the error string for the error defined in t_errno,
followed by the error string for the error defined in errno. If any
of the system calls/library routines invoked between the start of
_tx_error and when it calls perror() set errno, the output will be
incorrect.
Files
This doesn't look right to me. You're looking up t_strerror of the old errno, and then printing out the user-supplied string again anyway, and the no newline. Surely the lines starting at 58 should be along the lines of
if (local_t_errno == TSYSERR) {
(void) write(2, ": ", 2);
c = strerror(local_errno);
n = strlen(c);
(void) write(2, c, (unsigned)n);
}
(void) write(2, "\n", 1);
Cheers,
Rob
Added the changed commented by Rob McMahon.
Still need another review.
- Status changed from New to Feedback
- Assignee changed from John Doe to Gary Mills
- % Done changed from 100 to 80
- Difficulty set to Medium
- Tags set to needs-triage
I've made the minimum changes to resolve the problem noted in this bug report. However, I don't have a way to test this version or to reproduce the problem. Can anyone help with this?
Resolved in ace0359e9b3ac0b4bb7ddb51ae9138de3df33789
- Category set to lib - userland libraries
- Status changed from Feedback to Resolved
- % Done changed from 80 to 100
- Tags deleted (
needs-triage)
Also available in: Atom
PDF