diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-07-15 18:55:58 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-07-15 18:55:58 -0400 |
commit | 4b54ea891652138a8d58399bbbfdbb852b70eabd (patch) | |
tree | 12f8f5eac9e735909223542818bb3f9fefc70ef0 /src/c | |
parent | 4593948fd27e6cdc4c24a0b008ce1beac4df2560 (diff) |
Make 'static' protocol handle unlimited retry
Diffstat (limited to 'src/c')
-rw-r--r-- | src/c/static.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/c/static.c b/src/c/static.c index 76b04e45..6be67237 100644 --- a/src/c/static.c +++ b/src/c/static.c @@ -25,15 +25,18 @@ int main(int argc, char *argv[]) { ctx = uw_init(0, NULL, log_debug); uw_set_app(ctx, &uw_application); - fk = uw_begin(ctx, argv[1]); - - if (fk == SUCCESS) { - uw_print(ctx, 1); - puts(""); - return 0; - } else { - fprintf(stderr, "Error!\n"); - return 1; + + while (1) { + fk = uw_begin(ctx, argv[1]); + + if (fk == SUCCESS) { + uw_print(ctx, 1); + puts(""); + return 0; + } else if (fk != UNLIMITED_RETRY) { + fprintf(stderr, "Error: %s\n", uw_error_message(ctx)); + return 1; + } } } |