From f7c4dfd30ad1cbd027e62527865781bae482e4f2 Mon Sep 17 00:00:00 2001 From: ulgal-park Date: Thu, 16 Dec 2021 17:29:36 +0900 Subject: [PATCH] debug: fix printing error msg to use strerror_r() for thread safety Change-Id: I337a002d274cd9eed971c58a086ecbce88f1b8d3 --- src/debug/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debug/debug.c b/src/debug/debug.c index a6761b7..5fc6d58 100644 --- a/src/debug/debug.c +++ b/src/debug/debug.c @@ -192,7 +192,7 @@ _headless_debug_redir_stdout(headless_debug_t *hdebug, void *data) fd = open("/run/pepper/stdout.txt", O_CREAT | O_WRONLY | O_APPEND, S_IWUSR | S_IWGRP); if (fd < 0) { - PEPPER_TRACE("Failed to open stdout.txt (errno=%s)\n", strerror(errno)); + PEPPER_TRACE("Failed to open stdout.txt (errno=%m)\n"); return; } @@ -215,7 +215,7 @@ _headless_debug_redir_stderr(headless_debug_t *hdebug, void *data) fd = open("/run/pepper/stderr.txt", O_CREAT | O_WRONLY | O_APPEND, S_IWUSR | S_IWGRP); if (fd < 0) { - PEPPER_TRACE("Failed to open stderr.txt (errno=%s)\n", strerror(errno)); + PEPPER_TRACE("Failed to open stderr.txt (errno=%m)\n"); return; } -- 2.7.4