comparison src/thread/riscos/SDL_syssem.c @ 1851:536b0704b7d8

Make sure sem_wait didn't return early with EINTR. Fixes Bugzilla #231.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 17 May 2006 23:42:48 +0000
parents d910939febfa
children c121d94672cb a1b03ba2fcd0
comparison
equal deleted inserted replaced
1850:d5d3a6fe05a1 1851:536b0704b7d8
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 18
19 Sam Lantinga 19 Sam Lantinga
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22
23 #include <errno.h>
24
22 #include "SDL_config.h" 25 #include "SDL_config.h"
23 26
24 /* RISC OS semiphores based on linux code */ 27 /* RISC OS semiphores based on linux code */
25 28
26 29
130 if ( ! sem ) { 133 if ( ! sem ) {
131 SDL_SetError("Passed a NULL semaphore"); 134 SDL_SetError("Passed a NULL semaphore");
132 return -1; 135 return -1;
133 } 136 }
134 137
135 retval = sem_wait(sem->sem); 138 while ( ((retval = sem_wait(sem->sem)) == -1) && (errno == EINTR) ) {}
136 if ( retval < 0 ) { 139 if ( retval < 0 ) {
137 SDL_SetError("sem_wait() failed"); 140 SDL_SetError("sem_wait() failed");
138 } 141 }
139 return retval; 142 return retval;
140 } 143 }