Commit d01899e1 authored by Andrei Vagin's avatar Andrei Vagin

test/file_locks: use F_GETLK instead of F_GETLK64

F_GETLK64 has to be used with flock64

Reported-by: Mr Jenkins
parent 54daec18
...@@ -34,9 +34,9 @@ static int lock_reg(int fd, int cmd, int type, int whence, ...@@ -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) ...@@ -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) ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment