From 5054c7a52d950e0f66a088689a36ca5999987c97 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Tue, 12 Dec 2017 16:38:08 +0100 Subject: [PATCH] persist_timestamp: remove goto from persist_open --- persist_timestamp.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/persist_timestamp.c b/persist_timestamp.c index 19e27aa..c30b8f3 100644 --- a/persist_timestamp.c +++ b/persist_timestamp.c @@ -279,13 +279,11 @@ persist_open(int *valid, int secs) * If the size does not match the expected size it * is incomplete and should never be used */ - if (tssize == 0) - goto ret; - else if (tssize != sizeof(struct timespec) * 2) + if (tssize == sizeof(struct timespec) * 2) + *valid = validts(fd, secs) == 0; + else if (tssize != 0) errx(1, "corrupt timestamp file"); - *valid = validts(fd, secs) == 0; -ret: close(dirfd); return fd; } -- 2.39.2