Mail Archives: djgpp-workers/2000/12/12/03:12:03
> diff -ruN djgpp-cvs/src/libc/posix/fcntl/fcntl.c djgpp/src/libc/posix/fcntl/fcntl.c
> --- djgpp-cvs/src/libc/posix/fcntl/fcntl.c Thu Jun 3 13:27:38 1999
> +++ djgpp/src/libc/posix/fcntl/fcntl.c Mon Dec 11 20:41:46 2000
.
.
.
> int
> fcntl(int fd, int cmd, ...)
> {
.
.
.
> + case F_GETLK:
> + case F_SETLK:
> + case F_SETLKW:
> + {
> + struct flock *lock_req = NULL; /* shut up -Wall */
> + int ret = -1;
> + off_t pos, cur_pos, lock_pos;
> + off_t len;
> +
> + /* First check if SHARE is loaded */
> + ret = _get_SHARE_status();
> +
> + if (!ret) /* Then SHARE is NOT loaded, just return success */
> + {
> + if (cmd == F_GETLK) /* Then make believe the lock is available */
> + lock_req->l_type = F_UNLCK;
> +
> + return ret;
> + }
> + else ret = -1; /* Restore default value */
> +
> + cur_pos = lseek(fd, 0, SEEK_CUR);
> + if (cur_pos < 0)
> + return -1; /* Assumes lseek has set errno */
Why are you using lseek() here and not llseek?
.
.
.
> + case F_GETLK64:
> + case F_SETLK64:
> + case F_SETLKW64:
> + {
> + struct flock64 *lock_req = NULL; /* shut up -Wall */
> + int ret = -1;
> + long long int ret64 = -1L;
> + offset_t pos, cur_pos, lock_pos;
> + offset_t len;
> +
> + /* First check if SHARE is loaded */
> + ret = _get_SHARE_status();
> +
> + if (!ret) /* Then SHARE is NOT loaded, just return success */
> + {
> + if (cmd == F_GETLK64) /* Then make believe the lock is available */
> + lock_req->l_type = F_UNLCK;
> +
> + return ret;
> + }
> + else ret = -1; /* Restore default value */
> +
> + cur_pos = llseek(fd, 0L, SEEK_CUR);
> + if (cur_pos < 0)
> + return -1; /* Assumes lseek has set errno */
^^^^^
Don't you mean llseek()? (Several occurences.)
Right,
MartinS
- Raw text -