]> git.tuebingen.mpg.de Git - osl.git/blobdiff - fd.c
fsck.c depends on errtab.h.
[osl.git] / fd.c
diff --git a/fd.c b/fd.c
index cd5232caf1339a61ae8d9a397395fe07214b6892..7d69a2f35b6fb3fe08ce487b6c02d3ebe557c9f2 100644 (file)
--- a/fd.c
+++ b/fd.c
@@ -342,15 +342,11 @@ int truncate_file(const char *path, off_t size)
 
        ret = osl_stat(path, &statbuf);
        if (ret < 0)
-               goto out;
+               return ret;
        ret = -E_OSL_BAD_SIZE;
        if (statbuf.st_size < size)
-               goto out;
-       ret = -E_OSL_TRUNC;
+               return ret;
        if (truncate(path, statbuf.st_size - size) < 0)
-               goto out;
-       ret = 1;
-out:
-       return ret;
+               return -ERRNO_TO_ERROR(errno);
+       return 1;
 }
-