Fix to handle F_SETLKW64 in the test code 23/222523/1 accepted/tizen/unified/20200116.104151 submit/tizen/20200116.015057
authorSemun Lee <semun.lee@samsung.com>
Thu, 16 Jan 2020 01:02:21 +0000 (10:02 +0900)
committerSemun Lee <semun.lee@samsung.com>
Thu, 16 Jan 2020 01:02:21 +0000 (10:02 +0900)
glibc is changed to call fcntl64 in a certain configuration.

refer to: https://sourceware.org/git/?p=glibc.git;a=commit;h=06ab719d30b01da401150068054d3b8ea93dd12f

Change-Id: Id89344430e0c85a4cf6e0bd7537c143add247d18
Signed-off-by: Semun Lee <semun.lee@samsung.com>
src/tests/logger.c

index 2527d40..921cdb0 100644 (file)
@@ -327,7 +327,7 @@ int __real_fcntl(int fd, int cmd, ...);
 int __wrap_fcntl(int fd, int cmd, ...)
 {
        // We allow fcntl_correct == 0 for the same reason as in __wrap_open
-       if (fcntl_correct == 0 && cmd == F_SETLKW) {
+       if (fcntl_correct == 0 && (cmd == F_SETLKW || cmd == F_SETLKW64)) {
                va_list args;
                va_start(args, cmd);
                struct flock *flock = va_arg(args, struct flock *);
@@ -364,7 +364,7 @@ int __wrap_fcntl64(int fd, int cmd, ...)
                assert(va_arg(args, int) == (O_APPEND | O_NOATIME | O_NONBLOCK));
                va_end(args);
                return 0;
-       } else if (cmd == F_SETLKW && fcntl_correct != 0) {
+       } else if ((cmd == F_SETLKW || cmd == F_SETLKW64) && fcntl_correct != 0) {
                va_list args;
                va_start(args, cmd);
                struct flock *flock = va_arg(args, struct flock *);