debug: fix printing error msg to use strerror_r() for thread safety 23/268123/2
authorulgal-park <ulgal.park@samsung.com>
Thu, 16 Dec 2021 08:29:36 +0000 (17:29 +0900)
committerSeongmin Park <ulgal.park@samsung.com>
Fri, 17 Dec 2021 04:23:28 +0000 (04:23 +0000)
Change-Id: I337a002d274cd9eed971c58a086ecbce88f1b8d3

src/debug/debug.c

index a6761b7..5fc6d58 100644 (file)
@@ -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;
        }