X-Git-Url: http://git.tuebingen.mpg.de/?p=osl.git;a=blobdiff_plain;f=fd.c;h=7d69a2f35b6fb3fe08ce487b6c02d3ebe557c9f2;hp=cd5232caf1339a61ae8d9a397395fe07214b6892;hb=dfd3368c03d72660b1e5dba55b23395e234d0963;hpb=3c96f3b4f7bb1be1c630085981e83eb0260b99a7 diff --git a/fd.c b/fd.c index cd5232c..7d69a2f 100644 --- 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; } -