From: Duncaen Date: Tue, 12 Dec 2017 15:38:08 +0000 (+0100) Subject: persist_timestamp: remove goto from persist_open X-Git-Tag: v6.6~48 X-Git-Url: https://git.armaanb.net/?p=opendoas.git;a=commitdiff_plain;h=5054c7a52d950e0f66a088689a36ca5999987c97 persist_timestamp: remove goto from persist_open --- 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; }