aboutsummaryrefslogtreecommitdiffstats
path: root/src/rcyn-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rcyn-client.c')
-rw-r--r--src/rcyn-client.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/rcyn-client.c b/src/rcyn-client.c
index 152dc87..80da7d7 100644
--- a/src/rcyn-client.c
+++ b/src/rcyn-client.c
@@ -287,25 +287,22 @@ status_check(
rcyn_t *rcyn,
time_t *expire
) {
- int rc, exp;
+ int rc;
- if (!strcmp(rcyn->reply.fields[0], _yes_)) {
+ if (!strcmp(rcyn->reply.fields[0], _yes_))
rc = 1;
- exp = 1;
- } else if (!strcmp(rcyn->reply.fields[0], _no_)) {
+ else if (!strcmp(rcyn->reply.fields[0], _no_))
rc = 0;
- exp = 1;
- } else if (!strcmp(rcyn->reply.fields[0], _done_)) {
+ else if (!strcmp(rcyn->reply.fields[0], _done_))
rc = -EEXIST;
- exp = 2;
- } else {
+ else
rc = -EPROTO;
- exp = rcyn->reply.count;
- }
- if (exp < rcyn->reply.count)
- *expire = strtoll(rcyn->reply.fields[exp], NULL, 10);
+
+ if (rcyn->reply.count >= 2)
+ *expire = strtoll(rcyn->reply.fields[1], NULL, 10);
else
*expire = 0;
+
return rc;
}