Use the appropriate type to store and check the return value from lseek.
This prevents from misinterpreting high offsets as errors.
Change-Id: I15e92be3454af20ee6611c2a7ddfc1b597d639c2
Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-on: https://review.whamcloud.com/29674
Tested-by: Jenkins
Reviewed-by: Thomas LEIBOVICI <thomas.leibovici@cea.fr>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Stephan Thiell <sthiell@stanford.edu>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
}
if (startrec != 0) {
- rc = lseek(cp->clp_fd, startrec, SEEK_SET);
- if (rc < 0) {
+ off_t res;
+
+ res = lseek(cp->clp_fd, startrec, SEEK_SET);
+ if (res == (off_t)-1) {
rc = -errno;
goto out_close;
}