fix SIGINT handling

This commit is contained in:
Felix Fietkau 2011-02-06 02:19:54 +01:00
parent 4534209ea8
commit 2e83a5fab2
2 changed files with 3 additions and 0 deletions

View file

@ -124,6 +124,8 @@ static bool recv_retry(int fd, struct iovec *iov, bool wait)
bytes = read(fd, iov->iov_base, iov->iov_len); bytes = read(fd, iov->iov_base, iov->iov_len);
if (bytes < 0) { if (bytes < 0) {
bytes = 0; bytes = 0;
if (uloop_cancelled)
return false;
if (errno == EINTR) if (errno == EINTR)
continue; continue;

View file

@ -98,6 +98,7 @@ int main(int argc, char **argv)
uloop_init(); uloop_init();
ubus_add_uloop(ctx); ubus_add_uloop(ctx);
uloop_run(); uloop_run();
uloop_done();
ubus_free(ctx); ubus_free(ctx);
return 0; return 0;