wait_handler = handler;
}
+int call_wait_handler(int timeout)
+{
+ if (!wait_handler)
+ return -ENOSYS;
+ return wait_handler(timeout);
+}
+
void init_completion(struct completion *c)
{
LASSERT(c != NULL);
{
LASSERT(c != NULL);
do {
- if (wait_handler)
- wait_handler(1000);
- else
+ if (call_wait_handler(1000) < 0)
break;
} while (c->done == 0);
}
{
LASSERT(c != NULL);
do {
- if (wait_handler)
- wait_handler(1000);
- else
+ if (call_wait_handler(1000) < 0)
break;
} while (c->done == 0);
return 0;