2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 22:05:36 +00:00

test/file_locks: use F_GETLK instead of F_GETLK64

F_GETLK64 has to be used with flock64

Reported-by: Mr Jenkins
This commit is contained in:
Andrei Vagin
2018-11-01 18:25:37 +03:00
parent 54daec1899
commit d01899e15b

View File

@@ -34,9 +34,9 @@ static int lock_reg(int fd, int cmd, int type, int whence,
}
#define set_read_lock(fd, whence, offset, len) \
lock_reg(fd, F_SETLK64, F_RDLCK, whence, offset, len)
lock_reg(fd, F_SETLK, F_RDLCK, whence, offset, len)
#define set_write_lock(fd, whence, offset, len) \
lock_reg(fd, F_SETLK64, F_WRLCK, whence, offset, len)
lock_reg(fd, F_SETLK, F_WRLCK, whence, offset, len)
static int check_read_lock(int fd, int whence, off_t offset, off_t len)
{
@@ -50,7 +50,7 @@ static int check_read_lock(int fd, int whence, off_t offset, off_t len)
lock.l_pid = -1;
errno = 0;
ret = fcntl(fd, F_GETLK64, &lock);
ret = fcntl(fd, F_GETLK, &lock);
if (ret == -1) {
pr_perror("F_GETLK failed.");
return -1;
@@ -79,7 +79,7 @@ static int check_write_lock(int fd, int whence, off_t offset, off_t len)
lock.l_pid = -1;
errno = 0;
ret = fcntl(fd, F_GETLK64, &lock);
ret = fcntl(fd, F_GETLK, &lock);
if (ret == -1) {
pr_perror("F_GETLK failed.");
return -1;