On 27 Sep 2010, at 10:03am, Dustin Sallings wrote:

>       I happened to notice this code in the output of a git grep somewhere:
> 
>               usleep(10000000); /* wait 10 sec and try the lock again */ 
> 
>       usleep is documented to fail with EINVAL if its argument is greater 
> than 1,000,000.  I'm not sure if that takes effect on all platforms, but it 
> could very well reduce to a quick function that just sets errno if usleep 
> fails.

I think this differs for different platforms.  For instance:

http://www.manpagez.com/man/3/usleep/

makes no mention of that fault.

Since the time for sleeping is an integer number of seconds it's probably 
simplest just to replace this call with one to sleep(10).  sleep() is defined 
in POSIX.1 so I believe it should be available in a library for every platform 
SQLite is expected to run on.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to