Austin Group Defect Tracker

Aardvark Mark III


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000166 [1003.1(2008)/Issue 7] System Interfaces Comment Error 2009-10-09 15:26 2009-10-15 15:43
Reporter geoffclare View Status public  
Assigned To ajosey
Priority normal Resolution Accepted  
Status Resolved  
Name Geoff Clare
Organization The Open Group
User Reference
Section wait
Page Number 2185
Line Number 68859,68887
Interp Status ---
Final Accepted Text
Summary 0000166: errno indeterminate in wait() example
Description The second example on the wait() page has a signal handler that does
not save and restore errno. Thus the value of errno where it is used
(via perror()) in main() is indeterminate if the signal handler has
been called.

Admittedly the problem could only occur if a fork() error is
encountered after the 2 seconds that the first child sleeps
(i.e. the system would have to be very slow, or heavily loaded),
but I think the change is still worth making in order to demonstrate
the proper way to write signal handlers which make calls that can
change errno.
Desired Action At line 68859 insert:

    int sav_errno = errno;

before:

    int status;

After line 68887 add:

    errno = sav_errno;

(indented the same amount as the '}' on line 68887).
Tags tc1-2008
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2009-10-09 15:26 geoffclare New Issue
2009-10-09 15:26 geoffclare Status New => Under Review
2009-10-09 15:26 geoffclare Assigned To => ajosey
2009-10-09 15:26 geoffclare Name => Geoff Clare
2009-10-09 15:26 geoffclare Organization => The Open Group
2009-10-09 15:26 geoffclare Section => wait
2009-10-09 15:26 geoffclare Page Number => 2185
2009-10-09 15:26 geoffclare Line Number => 68859,68887
2009-10-09 15:26 geoffclare Interp Status => ---
2009-10-15 15:43 Don Cragun Status Under Review => Resolved
2009-10-15 15:43 Don Cragun Resolution Open => Accepted
2010-08-27 13:05 ajosey Tag Attached: tc1-2008


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker