mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00

The profiler's signal handler clobbers errno, via its calls to sem_post, or via other functions that it transitively calls. TSan complains about this, as a sample arriving at the wrong time could make it look like a function that failed actually succeeded, or vice versa. Ensure that the signal handler preserves the state of the world by saving and restoring errno around its operation.