[07/14] alpine: call write instead of fprintf

Submitted by Andrey Vagin on June 1, 2018, 9:02 p.m.

Details

Message ID 20180601210304.30164-8-avagin@virtuozzo.com
State Accepted
Series "More changes to be compatible with python 3"
Headers show

Commit Message

Andrey Vagin June 1, 2018, 9:02 p.m.
fprintf in Alpine Linux calls writev, which is prohibited in the
SECCOMP_MODE_STRICT mode.

Patch hide | download patch | download mbox

===================== Run zdtm/static/seccomp_strict in h ======================
Start test
Test is SUID
./seccomp_strict --pidfile=seccomp_strict.pid --outfile=seccomp_strict.out
make: *** [Makefile:385: seccomp_strict.pid] Error 1
 Test zdtm/static/seccomp_strict FAIL at start: [Errno 2] No such file or directory: 'zdtm/static/seccomp_strict.pid'
Test output: ================================
22:45:24.661:    38: ERR: seccomp_strict.c:97: read (errno = 2 (No such file or directory))
22:45:24.662:    37: ERR: test.c:315: Test exited unexpectedly with code 1

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
---
 test/zdtm/lib/msg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/zdtm/lib/msg.c b/test/zdtm/lib/msg.c
index 7b8d74dc4..04cd40167 100644
--- a/test/zdtm/lib/msg.c
+++ b/test/zdtm/lib/msg.c
@@ -64,6 +64,6 @@  skip:
 	off += vsnprintf(buf + off, sizeof(buf) - off, format, arg);
 	va_end(arg);
 
-	fprintf(stderr, "%s", buf);
+	write(2, buf, off);
 	errno = __errno;
 }