]> git.armaanb.net Git - opendoas.git/blobdiff - persist_timestamp.c
persist_timestamp: remove goto from persist_open
[opendoas.git] / persist_timestamp.c
index 19e27aa34d459eaaf893ae37a050212626dbd111..c30b8f350947dffe1eaa3ab92dc22a257dac8e3f 100644 (file)
@@ -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;
 }