diff --git a/meow_ui_log.c b/meow_ui_log.c index d5125ba..3817ea8 100644 --- a/meow_ui_log.c +++ b/meow_ui_log.c @@ -154,11 +154,12 @@ static void sigusr1_guard(int sig) { (void)sig; if (!g_log_open_tried) { g_log_open_tried = 1; log_open(); } - if (g_log_fd >= 0) { - char line[128]; - int n = snprintf(line, sizeof line, "%llu [%s] WARN sigusr1: ignored (guard)\n", - (unsigned long long)meow_ui_time_ms(), g_app_id); - if (n > 0) { ssize_t w = write(g_log_fd, line, (size_t)n); (void)w; } + char line[128]; + int n = snprintf(line, sizeof line, "%llu [%s] WARN sigusr1: ignored (guard)\n", + (unsigned long long)meow_ui_time_ms(), g_app_id); + if (n > 0) { + if (g_log_fd >= 0) { ssize_t w = write(g_log_fd, line, (size_t)n); (void)w; } + else { ssize_t w = write(2, line, (size_t)n); (void)w; } /* 无日志目录:写 stderr,护栏可观测 */ } /* 不 exit、不返回处理:返回交给 on_swipe/SDK。这里仅记录并吞掉。 */ } diff --git a/test_notif_gesture b/test_notif_gesture index feb309b..fdbfced 100755 Binary files a/test_notif_gesture and b/test_notif_gesture differ diff --git a/test_notif_open b/test_notif_open index 5ea8079..46ec474 100755 Binary files a/test_notif_open and b/test_notif_open differ