ioquake / ioq3

The ioquake3 community effort to continue supporting/developing id's Quake III Arena
https://ioquake3.org/
GNU General Public License v2.0
2.42k stars 529 forks source link

Use nanosleep(2) instead of usleep(3) #652

Closed alanzhao1 closed 6 months ago

alanzhao1 commented 8 months ago

usleep(3) was declared obsolete in POSIX.1-2001 and removed in POSIX.1-2008 and nanosleep(2) was recommended to be used instead.

alanzhao1 commented 6 months ago

@zturtleman - could you please take a look and approve/merge if this looks good? (I don't have permissions to add reviewers to PRs in this repo.)

zturtleman commented 6 months ago

Thanks.

This only affects the Unix-like dedicated server without a TTY and no map loaded (non-interactive server that fatal errored?) and the unused autoupdater. I tested the code path on macOS 10.6 (and 10.5 ppc binaries) and Debian 12 that it works and has similar CPU usage.