Skip to contentSkip to conversation

include/SAFE_IOCTL() fix return value type

PATCH New Cyril Hrubis 1 participant 1 message Mar 18, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 include/SAFE_IOCTL() fix return value type

This adds the same trick we use for SAFE_FCNTL() to SAFE_IOCTL(), the added coma + zero forces the return value to be numeric in all cases so that compiler will work fine in cases that we want to store the resulting value from SAFE_IOCTL().

CC Federico Bonfiglio <[email protected]>
---
 include/tst_safe_macros.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/tst_safe_macros.h +1 -1
index d31762f4a..5e85abc9c 100644
@@ -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_;})
 
 #define SAFE_FCNTL(fd, cmd, ...)                            \
Signature · 1 line
2.19.2