line safer

This commit is contained in:
Axel Kittenberger 2012-02-16 09:09:19 +01:00
parent 541bee5cf6
commit 08ad1f4151

View File

@ -1574,13 +1574,14 @@ masterloop(lua_State *L)
observance_action = true; observance_action = true;
for(pi = 0; pi < observances_len; pi++) { for(pi = 0; pi < observances_len; pi++) {
struct observance *obs = observances + pi; struct observance *obs = observances + pi;
if (hup || term) { if (hup || term) break;
break;
}
if (obs->ready && FD_ISSET(obs->fd, &rfds)) { if (obs->ready && FD_ISSET(obs->fd, &rfds)) {
obs->ready(L, obs); obs->ready(L, obs);
} }
if (hup || term) break; if (hup || term) break;
if (nonobservances_len > 0 && if (nonobservances_len > 0 &&
nonobservances[nonobservances_len-1] == obs->fd) { nonobservances[nonobservances_len-1] == obs->fd) {
// TODO breaks if more nonobserves // TODO breaks if more nonobserves