From patchwork Fri Jan 10 15:14:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1221181 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47vRNz6tW6z9sP6 for ; Sat, 11 Jan 2020 02:14:59 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id DD3CF3C2599 for ; Fri, 10 Jan 2020 16:14:56 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [IPv6:2001:4b78:1:20::6]) by picard.linux.it (Postfix) with ESMTP id 7D84F3C252C for ; Fri, 10 Jan 2020 16:14:54 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id C39FB1401D85 for ; Fri, 10 Jan 2020 16:14:53 +0100 (CET) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 05FEBAD2C; Fri, 10 Jan 2020 15:14:53 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Fri, 10 Jan 2020 16:14:43 +0100 Message-Id: <20200110151443.212842-1-pvorel@suse.cz> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it Subject: [LTP] [PATCH 1/1] tst_device: use raw syscall in the tst_device.h X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Li Wang To follow up commit 447c223db ("tst_device: include unistd.h"). Reported-by: Petr Vorel Suggested-by: Cyril Hrubis Signed-off-by: Li Wang Reviewed-by: Cyril Hrubis [pvorel: Removed _XOPEN_SOURCE from affected tests to really fix the issue and aren't needed] Reviewed-by: Petr Vorel Tested-by: Petr Vorel Fixes: eca0fa3c3 ("tst_device: add new tst_dev_sync") Signed-off-by: Petr Vorel --- Hi, tested on https://travis-ci.org/pevik/ltp/builds/635305638 Please anybody ack and merge, so we can move on with merging other things before git freeze. NOTE: Debian failures are caused by bug in libtirpc 1.2.5, will be fixed by https://patchwork.ozlabs.org/patch/1216506/ Kind regards, Petr include/tst_device.h | 5 +++-- testcases/kernel/syscalls/fadvise/posix_fadvise01.c | 1 - testcases/kernel/syscalls/fadvise/posix_fadvise02.c | 1 - testcases/kernel/syscalls/fadvise/posix_fadvise03.c | 1 - testcases/kernel/syscalls/fadvise/posix_fadvise04.c | 1 - testcases/kernel/syscalls/pwrite/pwrite02.c | 2 -- 6 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/tst_device.h b/include/tst_device.h index f277afd77..3db5275c9 100644 --- a/include/tst_device.h +++ b/include/tst_device.h @@ -19,6 +19,7 @@ #define TST_DEVICE_H__ #include +#include struct tst_device { const char *dev; @@ -75,9 +76,9 @@ int tst_detach_device(const char *dev_path); * simply before the tst_dev_bytes_written invocation. For easy to use, * we create this inline function tst_dev_sync. */ -static inline void tst_dev_sync(int fd) +static inline int tst_dev_sync(int fd) { - syncfs(fd); + return syscall(__NR_syncfs, fd); } /* diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise01.c b/testcases/kernel/syscalls/fadvise/posix_fadvise01.c index 2af040840..71e6454d8 100644 --- a/testcases/kernel/syscalls/fadvise/posix_fadvise01.c +++ b/testcases/kernel/syscalls/fadvise/posix_fadvise01.c @@ -20,7 +20,6 @@ * None */ -#define _XOPEN_SOURCE 600 #include #include diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise02.c b/testcases/kernel/syscalls/fadvise/posix_fadvise02.c index d533a7953..303f776e4 100644 --- a/testcases/kernel/syscalls/fadvise/posix_fadvise02.c +++ b/testcases/kernel/syscalls/fadvise/posix_fadvise02.c @@ -20,7 +20,6 @@ * None */ -#define _XOPEN_SOURCE 600 #include #include #include diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c index 5bada5f3d..98d8d2930 100644 --- a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c +++ b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c @@ -20,7 +20,6 @@ * None */ -#define _XOPEN_SOURCE 600 #include #include #include diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise04.c b/testcases/kernel/syscalls/fadvise/posix_fadvise04.c index d8d8fb601..f389a219b 100644 --- a/testcases/kernel/syscalls/fadvise/posix_fadvise04.c +++ b/testcases/kernel/syscalls/fadvise/posix_fadvise04.c @@ -20,7 +20,6 @@ * None */ -#define _XOPEN_SOURCE 600 #include #include #include diff --git a/testcases/kernel/syscalls/pwrite/pwrite02.c b/testcases/kernel/syscalls/pwrite/pwrite02.c index 056d44da2..221904cd7 100644 --- a/testcases/kernel/syscalls/pwrite/pwrite02.c +++ b/testcases/kernel/syscalls/pwrite/pwrite02.c @@ -18,8 +18,6 @@ * accessible address space, returns EFAULT. */ -#define _XOPEN_SOURCE 500 - #include #include #include