From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] Test ioctl syscall for NS_GET_* requests
Date: Mon, 18 Mar 2019 15:22:06 +0100 [thread overview]
Message-ID: <20190318142206.GA18993@rei> (raw)
In-Reply-To: <20190311072537.22080-1-fedebonfi95@gmail.com>
Hi!
> Thanks Cyril for your review. I hope this one is better, also I could't use
> SAFE_IOCTL because compilations fails this way:
>
> ioctl_ns06.c: In function 'run':
> ioctl_ns06.c:46:13: error: void value not ignored as it ought to be
> parent_fd = SAFE_IOCTL(child_fd, NS_GET_PARENT);
> ^
> <builtin>: recipe for target 'ioctl_ns06' failed
> make: *** [ioctl_ns06] Error 1
>
> I need the return value since it's the process pid. Am I doing somthing wrong
> with this safe call?
There is actually a bug in the macro, this patch should fix it:
diff --git a/include/tst_safe_macros.h b/include/tst_safe_macros.h
index b63e7493a..04aedb39a 100644
--- a/include/tst_safe_macros.h
+++ b/include/tst_safe_macros.h
@@ -221,7 +221,7 @@ pid_t safe_getpgid(const char *file, const int lineno, pid_t pid);
({int tst_ret_ = ioctl(fd, request, ##__VA_ARGS__); \
tst_ret_ < 0 ? \
tst_brk(TBROK | TERRNO, \
- "ioctl(%i,%s,...) failed", fd, #request) \
+ "ioctl(%i,%s,...) failed", fd, #request), 0 \
: tst_ret_;})
I will send a patch fixing that.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2019-03-18 14:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-24 20:29 [LTP] [PATCH v1] Test ioctl syscall for NS_GET_* requests YourName
2019-03-04 16:16 ` Cyril Hrubis
2019-03-11 7:25 ` [LTP] [PATCH v2] " Federico Bonfiglio
2019-03-18 14:22 ` Cyril Hrubis [this message]
2019-03-18 15:30 ` Cyril Hrubis
2019-03-19 18:09 ` [LTP] [PATCH v3] " Federico Bonfiglio
2019-03-26 19:20 ` Cyril Hrubis
2019-03-28 20:22 ` [LTP] [PATCH v4 1/2] include/SAFE_UNSHARE() macro added Federico Bonfiglio
2019-04-03 15:19 ` Cyril Hrubis
2019-03-28 20:22 ` [LTP] [PATCH v4 2/2] Test ioctl syscall for NS_GET_* requests Federico Bonfiglio
2019-04-03 15:22 ` Cyril Hrubis
2019-04-11 19:25 ` [LTP] [PATCH v5] " Federico Bonfiglio
2019-04-12 14:33 ` Cyril Hrubis
2019-05-06 10:14 ` [LTP] NS_* ioctl commands fail in 32bit compat mode (-m32) Richard Palethorpe
2019-05-06 10:39 ` Richard Palethorpe
2019-05-13 9:00 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190318142206.GA18993@rei \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox