fixed bug in SQL access where timeout was compared to a negative value

This commit is contained in:
csoler 2020-03-05 20:51:02 +01:00
parent 09fe628415
commit f59193b625
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C

View file

@ -185,7 +185,7 @@ bool RetroDb::execSQL(const std::string &query){
uint32_t delta = 3; uint32_t delta = 3;
rstime_t stamp = time(NULL), now = 0; rstime_t stamp = time(NULL);
bool timeOut = false, ok = false; bool timeOut = false, ok = false;
while(!timeOut){ while(!timeOut){
@ -202,10 +202,8 @@ bool RetroDb::execSQL(const std::string &query){
break; break;
} }
now = time(NULL); if(time(NULL) > stamp + TIME_LIMIT)
delta = stamp - now; {
if(delta > TIME_LIMIT){
ok = false; ok = false;
timeOut = true; timeOut = true;
} }