ioquake / ioq3

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

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

Closed alanzhao1 closed 1 month ago

alanzhao1 commented 3 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 1 month 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 1 month 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.