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"
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;
}
-