diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-05-18 11:14:58 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-05-18 11:19:04 +0200 |
commit | 831be2ecee569275b9e32711613ec6ef0567b566 (patch) | |
tree | 60e55db3f46c27ae244ca1e3cc9bd46dd644cd1a /fs | |
parent | c46a84104952d24e89467f83791e0bc72615d0fe (diff) | |
download | barebox-831be2ecee569275b9e32711613ec6ef0567b566.tar.gz barebox-831be2ecee569275b9e32711613ec6ef0567b566.tar.xz |
lseek: return -1 instead of -errno
The patch making errno a positive value has another bug:
lseek was switched to return -errno instead of -1. This does not
work since we can lseek we can address the whole 4G address space,
have of which has a negative offset when interpreted as a signed
integer. Let lseek return -1 on failure again instead.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fs.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -732,13 +732,13 @@ off_t lseek(int fildes, off_t offset, int whence) goto out; } - ret = fsdrv->lseek(dev, f, pos); + return fsdrv->lseek(dev, f, pos); out: if (ret) errno = -ret; - return ret; + return -1; } EXPORT_SYMBOL(lseek); |