Changeset 3581 in kBuild
- Timestamp:
- Jan 5, 2023 12:42:11 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/posixos.c
r3512 r3581 40 40 If we use pselect() this will never be created and always -1. 41 41 */ 42 static int job_rfd = -1;42 static int volatile job_rfd = -1; /* bird: added volatile to try ensure atomic update. */ 43 43 44 44 /* Token written to the pipe (could be any character...) */ … … 52 52 return 0; 53 53 #else 54 EINTRLOOP (job_rfd, dup (job_fds[0])); 55 if (job_rfd >= 0) 56 CLOSE_ON_EXEC (job_rfd); 57 58 return job_rfd; 54 /* bird: modified to use local variable and only update job_rfd once, otherwise 55 we're racing the signal handler clearing and closing this. */ 56 int new_job_rfd; 57 EINTRLOOP (new_job_rfd, dup (job_fds[0])); 58 if (new_job_rfd >= 0) 59 CLOSE_ON_EXEC (new_job_rfd); 60 61 job_rfd = new_job_rfd; 62 return new_job_rfd; 59 63 #endif 60 64 }
Note:
See TracChangeset
for help on using the changeset viewer.