From dfd3368c03d72660b1e5dba55b23395e234d0963 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 6 Jun 2008 14:22:42 +0200 Subject: [PATCH] Kill E_OSL_TRUNC. --- errlist | 1 - fd.c | 12 ++++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/errlist b/errlist index 0870bca..06e2e80 100644 --- a/errlist +++ b/errlist @@ -15,7 +15,6 @@ BAD_DATA_SIZE "wrong data size for fixed-size column" NOT_MAPPED "file not mapped" ALREADY_MAPPED "file already mapped" BAD_SIZE "invalid size specified" -TRUNC "failed to truncate file" BAD_TABLE "table not open" BAD_TABLE_DESC "invalid table description" RB_KEY_EXISTS "key already exists in rbtree" 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; } - -- 2.30.2