mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 14:55:39 +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:
@@ -34,9 +34,9 @@ static int lock_reg(int fd, int cmd, int type, int whence,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define set_read_lock(fd, whence, offset, len) \
|
#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) \
|
#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)
|
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;
|
lock.l_pid = -1;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
ret = fcntl(fd, F_GETLK64, &lock);
|
ret = fcntl(fd, F_GETLK, &lock);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
pr_perror("F_GETLK failed.");
|
pr_perror("F_GETLK failed.");
|
||||||
return -1;
|
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;
|
lock.l_pid = -1;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
ret = fcntl(fd, F_GETLK64, &lock);
|
ret = fcntl(fd, F_GETLK, &lock);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
pr_perror("F_GETLK failed.");
|
pr_perror("F_GETLK failed.");
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user