site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com This may be a simple one but I haven't figured it out. Suppose you have a server that does (in pseudo code): signal_handler () { if TERM signal then runserver = 0; } main () { for (runserver=1;runserver;) { select (descriptors, timeout=1second); do descriptor event based stuff; do periodic stuff; } exit gracefully; } Any easy solutions? -Jamil _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... Now if you send a TERM signal to this process but for whatever reason there is no activity on the file descriptors. Then the process will hang into the select() until a descriptor becomes ready. You would think that the 1 second should timeout and then it should exit gracefully (which is the intent). It seems the best I can tell is that the select() call is getting restarted due to the signal but somehow it is restarted without the timeout. This email sent to site_archiver@lists.apple.com
participants (1)
-
Jamil Weatherbee