From patchwork Wed Jun 10 11:46:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Sakhonchik X-Patchwork-Id: 89658 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25C55CD8CB9 for ; Wed, 10 Jun 2026 11:46:36 +0000 (UTC) Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.18355.1781091987092163099 for ; Wed, 10 Jun 2026 04:46:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=iZa9gLBN; spf=pass (domain: gmail.com, ip: 209.85.208.47, mailfrom: frezidok1@gmail.com) Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-68b90fc6a1dso2775330a12.1 for ; Wed, 10 Jun 2026 04:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781091985; x=1781696785; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oOlgvYhHTzVRNQlneINMF2oinsKnP+jOhYRFb+5Y7Y0=; b=iZa9gLBNqRosf43b95XZsiS0dIaQAf+Cr+WTYRXpNT6KSzVU5RtiPM6A7g3zb6TAWO IbxAnupXZvn3H9h0rd76ZUVD4dIL0uA9A678yUrIvJ0Gddcd7EXTqyjl+hPLbtQI9XTQ F0izc7NXzkSQwVqBrmdAtF7las7bSd8VvW9L/NacQ8gG48n9ZQ+FKjSB9mC+k5QPD5eB DJ+IweFl0Y08Zfee5J2m4QsxfUPxhVbqu1i0GNxrck3o2DBjIOFYtHgbHbL1pnrmwrgP 7ba8RYY3OMPEeu6O3KIIqJSWnUmmdiJ68dfIeYBOuoWrmFw1LrHuAegkRgXYXSbvvNM+ qLYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781091985; x=1781696785; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oOlgvYhHTzVRNQlneINMF2oinsKnP+jOhYRFb+5Y7Y0=; b=UDbywdtkIX3MNgssW4AfRkdcquq8aMkNhr8rF3e0HeXBxFW7R9vGH1ttnAIkw0wimn lAj3sqqrSas90k9PZjyMvL/71KCs2QPDUAbzmIn4aFmP002evzqWCmuekUNiZ0/CoXwN RMvJxWPHBYNmPGRLzISTI6CyYouRn5G53PcnMZ7wrvDX8aAtIe0QCvEJL+IapCRhZLH5 u9Dg6eN/S0XAN6rqWTQxI2hMjs3R7uOAc+h7pL8hVfJ6b7pTJtKwNOzcQ1iyCvTfpbZH VHgCs0egTe4uAvTHqML0py1g4KcA23T/G6EfXSAcJeiXDQAEySyWmkKu5fX+31Fskpt0 sxDA== X-Gm-Message-State: AOJu0YzFGDeJ7dhhQzhR379nnoVgz+niZNjmIjAKffBmEPWgI86zzjUt Ox0y76v9Yqfx9DlOEah2JkbwAa5N+yrPhKW5kquwInuTd+Q579WTX7Q2U4xabgCF X-Gm-Gg: Acq92OFoTgyi0Kg68keitK32wI/FB58qb+QZmnIGEpCKgDx4PPZkknYGrR5N+xgh9hu JgwK9iGjR58X5C6HCoRH+/k+dbxLzQzB9Vb7iBFeAdaB+tOoBXjDHFhCy65w7H4hyR+WHverfYP gH/JTQgSKXCJagZ0h3jrs9bcVfo+2Pz1DeEA5PqmlCu5PojQvX/fPb2qYUShcEmFB1Zx3Om7Q0h 3PXA8K1DlUarvOuOgvN+b2oaPG7m44rCHjEWtEwoVwH/EXOXRHwbXPnYSrPP64k4Aua4HuhoAAi Na/aT0brIqQMdHG2r+VRbUbfqMWJnw2J5mgp7yS1QYDCZocLs/lfkePCo7Tg8vxIJj46FkNB0Cv JWDkJbNssy0OzjywF3ULXU4Ho7vzxLveWBIS3oG9ufqLIcjYTwJOO6EBJxjDCS5pU19YtQOnqSK sor6YCiwUpK0Yf89Cy1+FeAdZcln/jvdZFVaAtd8k= X-Received: by 2002:a05:6402:4487:b0:68f:9fd9:435a with SMTP id 4fb4d7f45d1cf-68ff2495467mr9397243a12.17.1781091985246; Wed, 10 Jun 2026 04:46:25 -0700 (PDT) Received: from ubuntu1.. ([194.87.83.187]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6912faea64dsm5997164a12.19.2026.06.10.04.46.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2026 04:46:24 -0700 (PDT) From: frezidok1@gmail.com To: yocto-patches@lists.yoctoproject.org Cc: Dmitry Sakhonchik Subject: [pseudo] [PATCH 1/8] pseudo_util: Change pseudo_diag() calls to appropriate logging macros Date: Wed, 10 Jun 2026 14:46:03 +0300 Message-ID: <20260610114610.60776-1-frezidok1@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 10 Jun 2026 11:46:36 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/4192 From: Dmitry Sakhonchik The patch is based on: [pseudo] pseudo: Add new logging macros and implements [YOCTO #12141] Signed-off-by: Dmitry Sakhonchik --- pseudo_util.c | 88 +++++++++++++++++++++++++-------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) base-commit: f554e5d2b207eb96754d2c62784419a46cb364ba diff --git a/pseudo_util.c b/pseudo_util.c index f8f2a2f..dbd979e 100644 --- a/pseudo_util.c +++ b/pseudo_util.c @@ -177,7 +177,7 @@ pseudo_get_value(const char *key) { value = NULL; if (!pseudo_env[i].key) - pseudo_diag("Unknown variable %s.\n", key); + pseudo_warning("Unknown variable %s.\n", key); return value; } @@ -202,12 +202,12 @@ pseudo_set_value(const char *key, const char *value) { if (new) pseudo_env[i].value = new; else - pseudo_diag("warning: failed to save new value (%s) for key %s\n", + pseudo_warning("failed to save new value (%s) for key %s\n", value, key); } else pseudo_env[i].value = NULL; } else { - if (!pseudo_util_initted) pseudo_diag("Unknown variable %s.\n", key); + if (!pseudo_util_initted) pseudo_warning("Unknown variable %s.\n", key); rc = -EINVAL; } @@ -350,7 +350,7 @@ without_libpseudo(char *list) { } list = strdup(list); if (!list) { - pseudo_diag("Couldn't allocate memory to remove libpseudo from environment.\n"); + pseudo_error("Couldn't allocate memory to remove libpseudo from environment.\n"); } while (list && !(*real_regexec)(&libpseudo_regex, list, 1, pmatch, 0)) { char *start = list + pmatch[0].rm_so; @@ -360,7 +360,7 @@ without_libpseudo(char *list) { memmove(start, end, strlen(end) + 1); ++counter; if (counter > 5) { - pseudo_diag("Found way too many libpseudo.so in environment, giving up.\n"); + pseudo_error("Found way too many libpseudo.so in environment, giving up.\n"); return list; } } @@ -621,7 +621,7 @@ pseudo_evlog_internal(char *fmt, ...) { event_log[i].data = pseudo_evlog_buffer + (PSEUDO_EVLOG_LENGTH * i); } } else { - pseudo_diag("fatal: can't allocate event log storage.\n"); + pseudo_error("can't allocate event log storage.\n"); } } @@ -668,7 +668,7 @@ pseudo_append_element(char *newpath, char *root, size_t allocated, char **pcurre if (!newpath || !pcurrent || !*pcurrent || !root || !element) { - pseudo_diag("pseudo_append_element: invalid args.\n"); + pseudo_warning("pseudo_append_element: invalid args.\n"); return -1; } @@ -689,7 +689,7 @@ pseudo_append_element(char *newpath, char *root, size_t allocated, char **pcurre * fall through and do standard processing */ if (!proc_path) - pseudo_diag("allocation failed seeking memory for path (%s).\n", newpath); + pseudo_warning("allocation failed seeking memory for path (%s).\n", newpath); else is_proc = 1; } @@ -729,7 +729,7 @@ pseudo_append_element(char *newpath, char *root, size_t allocated, char **pcurre /* current length, plus / / \0 */ /* => curlen + elen + 3 */ if (curlen + elen + 3 > allocated) { - pseudo_diag("pseudo_append_element: path too long (wanted %lu bytes).\n", (unsigned long) curlen + elen + 3); + pseudo_error("pseudo_append_element: path too long (wanted %lu bytes).\n", (unsigned long) curlen + elen + 3); return -1; } /* append a slash */ @@ -798,7 +798,7 @@ pseudo_append_element(char *newpath, char *root, size_t allocated, char **pcurre char *target_link_path = malloc(pseudo_path_max()); if (!target_link_path) - pseudo_diag("allocation failed seeking memory for path (%s/%s).\n", proc_path, linkbuf); + pseudo_error("allocation failed seeking memory for path (%s/%s).\n", proc_path, linkbuf); /* Fall through, nothing we can do here */ else { snprintf(target_link_path, target_link_max, "%s/%s", proc_path, linkbuf); @@ -865,7 +865,7 @@ pseudo_append_elements(char *newpath, char *root, size_t allocated, char **curre if (!newpath || !root || !current || !*current || !path) { - pseudo_diag("pseudo_append_elements: invalid arguments."); + pseudo_error("pseudo_append_elements: invalid arguments."); return -1; } if (!sbuf) { @@ -935,7 +935,7 @@ pseudo_fix_path(const char *base, const char *path, size_t rootlen, size_t basel int trailing_slash = 0; if (!path) { - pseudo_diag("can't fix empty path.\n"); + pseudo_warning("can't fix empty path.\n"); return 0; } if (baselen == 1) { @@ -957,7 +957,7 @@ pseudo_fix_path(const char *base, const char *path, size_t rootlen, size_t basel if (!pathbufs[pathbuf]) { pathbufs[pathbuf] = malloc(newpathlen); if (!pathbufs[pathbuf]) { - pseudo_diag("allocation failed seeking memory for path (%s).\n", path); + pseudo_error("allocation failed seeking memory for path (%s).\n", path); return 0; } } @@ -976,7 +976,7 @@ pseudo_fix_path(const char *base, const char *path, size_t rootlen, size_t basel * easier for the library. */ if (!newpath) { - pseudo_diag("allocation failed seeking memory for path (%s).\n", path); + pseudo_error("allocation failed seeking memory for path (%s).\n", path); return 0; } newpath[0] = '\0'; @@ -1037,7 +1037,7 @@ void pseudo_dropenv() { if (ld_preload) { ld_preload = without_libpseudo(ld_preload); if (!ld_preload) { - pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_LIBRARIES); + pseudo_error("can't allocate new %s variable.\n", PRELINK_LIBRARIES); } if (ld_preload && strlen(ld_preload)) { SETENV(PRELINK_LIBRARIES, ld_preload, 1); @@ -1056,7 +1056,7 @@ pseudo_dropenvp(char * const *envp) { new_envp = malloc((i + 1) * sizeof(*new_envp)); if (!new_envp) { - pseudo_diag("fatal: can't allocate new environment.\n"); + pseudo_error("can't allocate new environment.\n"); return NULL; } @@ -1065,7 +1065,7 @@ pseudo_dropenvp(char * const *envp) { if (STARTSWITH(envp[i], PRELINK_LIBRARIES "=")) { char *new_val = without_libpseudo(envp[i]); if (!new_val) { - pseudo_diag("fatal: can't allocate new environment variable.\n"); + pseudo_error("can't allocate new environment variable.\n"); return 0; } else { /* don't keep an empty value; if the whole string is @@ -1111,7 +1111,7 @@ pseudo_setupenv() { size_t len = strlen(libdir_path) + 1 + (strlen(libdir_path) + 2) + 1; char *newenv = malloc(len); if (!newenv) { - pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_PATH); + pseudo_error("can't allocate new %s variable.\n", PRELINK_PATH); } else { snprintf(newenv, len, "%s:%s64", libdir_path, libdir_path); SETENV(PRELINK_PATH, newenv, 1); @@ -1121,7 +1121,7 @@ pseudo_setupenv() { size_t len = strlen(ld_library_path) + 1 + strlen(libdir_path) + 1 + (strlen(libdir_path) + 2) + 1; char *newenv = malloc(len); if (!newenv) { - pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_PATH); + pseudo_error("can't allocate new %s variable.\n", PRELINK_PATH); } else { snprintf(newenv, len, "%s:%s:%s64", ld_library_path, libdir_path, libdir_path); SETENV(PRELINK_PATH, newenv, 1); @@ -1136,7 +1136,7 @@ pseudo_setupenv() { if (ld_preload) { ld_preload = with_libpseudo(ld_preload, libdir_path); if (!ld_preload) { - pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_LIBRARIES); + pseudo_error("can't allocate new %s variable.\n", PRELINK_LIBRARIES); } else { SETENV(PRELINK_LIBRARIES, ld_preload, 1); free(ld_preload); @@ -1144,7 +1144,7 @@ pseudo_setupenv() { } else { ld_preload = with_libpseudo("", libdir_path); if (!ld_preload) { - pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_LIBRARIES); + pseudo_error("can't allocate new %s variable.\n", PRELINK_LIBRARIES); } else { SETENV(PRELINK_LIBRARIES, ld_preload, 1); free(ld_preload); @@ -1216,7 +1216,7 @@ pseudo_setupenvp(char * const *envp) { j = 0; new_envp = malloc((env_count + 1) * sizeof(*new_envp)); if (!new_envp) { - pseudo_diag("fatal: can't allocate new environment.\n"); + pseudo_error("can't allocate new environment.\n"); return NULL; } @@ -1225,7 +1225,7 @@ pseudo_setupenvp(char * const *envp) { size_t len = strlen(PRELINK_PATH "=") + strlen(libdir_path) + 1 + (strlen(libdir_path) + 2) + 1; char *newenv = malloc(len); if (!newenv) { - pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_PATH); + pseudo_error("can't allocate new %s variable.\n", PRELINK_PATH); } else { snprintf(newenv, len, PRELINK_PATH "=%s:%s64", libdir_path, libdir_path); new_envp[j++] = newenv; @@ -1234,7 +1234,7 @@ pseudo_setupenvp(char * const *envp) { size_t len = strlen(ld_library_path) + 1 + strlen(libdir_path) + 1 + (strlen(libdir_path) + 2) + 1; char *newenv = malloc(len); if (!newenv) { - pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_PATH); + pseudo_error("can't allocate new %s variable.\n", PRELINK_PATH); } else { snprintf(newenv, len, "%s:%s:%s64", ld_library_path, libdir_path, libdir_path); new_envp[j++] = newenv; @@ -1247,18 +1247,18 @@ pseudo_setupenvp(char * const *envp) { if (ld_preload) { ld_preload = with_libpseudo(ld_preload, libdir_path); if (!ld_preload) { - pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_LIBRARIES); + pseudo_error("can't allocate new %s variable.\n", PRELINK_LIBRARIES); } else new_envp[j++] = ld_preload; } else { ld_preload = with_libpseudo("", libdir_path); if (!ld_preload) { - pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_LIBRARIES); + pseudo_error("can't allocate new %s variable.\n", PRELINK_LIBRARIES); } else { size_t len = strlen(PRELINK_LIBRARIES "=") + strlen(ld_preload) + 1; char *newenv = malloc(len); if (!newenv) { - pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_LIBRARIES); + pseudo_error("can't allocate new %s variable.\n", PRELINK_LIBRARIES); } else { snprintf(newenv, len, PRELINK_LIBRARIES "=%s", ld_preload); new_envp[j++] = newenv; @@ -1287,7 +1287,7 @@ pseudo_setupenvp(char * const *envp) { size_t len = strlen(pseudo_env[i].key) + 1 + strlen(pseudo_env[i].value) + 1; char *newenv = malloc(len); if (!newenv) { - pseudo_diag("fatal: can't allocate new variable.\n"); + pseudo_error("can't allocate new variable.\n"); } else { snprintf(newenv, len, "%s=%s", pseudo_env[i].key, pseudo_env[i].value); new_envp[j++] = newenv; @@ -1339,7 +1339,7 @@ pseudo_prefix_path(char *file) { char * prefix = pseudo_get_prefix(NULL); if (!prefix) { - pseudo_diag("You must set the PSEUDO_PREFIX environment variable to run pseudo.\n"); + pseudo_error("You must set the PSEUDO_PREFIX environment variable to run pseudo.\n"); exit(1); } @@ -1356,7 +1356,7 @@ pseudo_bindir_path(char *file) { char * bindir = pseudo_get_bindir(); if (!bindir) { - pseudo_diag("You must set the PSEUDO_BINDIR environment variable to run pseudo.\n"); + pseudo_error("You must set the PSEUDO_BINDIR environment variable to run pseudo.\n"); exit(1); } @@ -1373,7 +1373,7 @@ pseudo_libdir_path(char *file) { char * libdir = pseudo_get_libdir(); if (!libdir) { - pseudo_diag("You must set the PSEUDO_LIBDIR environment variable to run pseudo.\n"); + pseudo_error("You must set the PSEUDO_LIBDIR environment variable to run pseudo.\n"); exit(1); } @@ -1390,7 +1390,7 @@ pseudo_localstatedir_path(char *file) { char * localstatedir = pseudo_get_localstatedir(); if (!localstatedir) { - pseudo_diag("You must set the PSEUDO_LOCALSTATEDIR environment variable to run pseudo.\n"); + pseudo_error("You must set the PSEUDO_LOCALSTATEDIR environment variable to run pseudo.\n"); exit(1); } @@ -1424,7 +1424,7 @@ pseudo_get_prefix(char *pathname) { tmp_path = pseudo_fix_path(NULL, mypath, 0, 0, 0, AT_SYMLINK_NOFOLLOW); /* point s to the end of the fixed path */ if ((int) strlen(tmp_path) >= pseudo_path_max()) { - pseudo_diag("Can't expand path '%s' -- expansion exceeds %d.\n", + pseudo_error("Can't expand path '%s' -- expansion exceeds %d.\n", mypath, (int) pseudo_path_max()); } else { s = mypath + snprintf(mypath, pseudo_path_max(), "%s", tmp_path); @@ -1446,7 +1446,7 @@ pseudo_get_prefix(char *pathname) { strcpy(mypath, "/"); } - pseudo_diag("Warning: PSEUDO_PREFIX unset, defaulting to %s.\n", + pseudo_warning("PSEUDO_PREFIX unset, defaulting to %s.\n", mypath); pseudo_set_value("PSEUDO_PREFIX", mypath); s = pseudo_get_value("PSEUDO_PREFIX"); @@ -1702,7 +1702,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) { } pseudo_path = pseudo_localstatedir_path(defname); if (!pseudo_path) { - pseudo_diag("can't get path for prefix/%s\n", PSEUDO_LOGFILE); + pseudo_error("can't get path for prefix/%s\n", PSEUDO_LOGFILE); return -1; } } else { @@ -1716,7 +1716,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) { break; case 'd': if (pid) { - pseudo_diag("found second %%d in PSEUDO_DEBUG_FILE, ignoring.\n"); + pseudo_info("found second %%d in PSEUDO_DEBUG_FILE, ignoring.\n"); return -1; } else { pid = s; @@ -1724,7 +1724,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) { break; case 's': if (prog) { - pseudo_diag("found second %%s in PSEUDO_DEBUG_FILE, ignoring.\n"); + pseudo_info("found second %%s in PSEUDO_DEBUG_FILE, ignoring.\n"); return -1; } else { prog = s; @@ -1732,10 +1732,10 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) { break; default: if (isprint(s[1])) { - pseudo_diag("found unknown format character '%c' in PSEUDO_DEBUG_FILE, ignoring.\n", + pseudo_info("found unknown format character '%c' in PSEUDO_DEBUG_FILE, ignoring.\n", s[1]); } else { - pseudo_diag("found unknown format character '\\x%02x' in PSEUDO_DEBUG_FILE, ignoring.\n", + pseudo_info("found unknown format character '\\x%02x' in PSEUDO_DEBUG_FILE, ignoring.\n", (unsigned char) s[1]); } return -1; @@ -1750,7 +1750,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) { len += strlen(program_invocation_short_name); pseudo_path = malloc(len); if (!pseudo_path) { - pseudo_diag("can't allocate space for debug file name.\n"); + pseudo_error("can't allocate space for debug file name.\n"); return -1; } if (pid && prog) { @@ -1770,7 +1770,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) { } fd = open(pseudo_path, O_WRONLY | O_APPEND | O_CREAT | O_CLOEXEC, 0644); if (fd == -1) { - pseudo_diag("help: can't open log file %s: %s\n", pseudo_path, strerror(errno)); + pseudo_error("help: can't open log file %s: %s\n", pseudo_path, strerror(errno)); } else { /* try to force fd to prefer_fd. We do this because glibc's malloc * debug unconditionally writes to fd 2, and we don't want @@ -1799,7 +1799,7 @@ pseudo_debug_logfile(char *defname, int prefer_fd) { fd = pseudo_logfile(filename, defname, prefer_fd); if (fd > -1) { - pseudo_diag("debug_logfile: fd %d\n", fd); + pseudo_info("debug_logfile: fd %d\n", fd); pseudo_util_debug_fd = fd; return 0; } @@ -1864,7 +1864,7 @@ pseudo_dump_data(char *name, const void *v, size_t len) { const unsigned char *base = v; const unsigned char *data = base; int remaining = len; - pseudo_diag("%s at %p [%d byte%s]:\n", + pseudo_info("%s at %p [%d byte%s]:\n", name ? name : "data", v, (int) len, len == 1 ? "" : "s"); while (remaining > 0) { char *hexptr = hexbuf; @@ -1882,7 +1882,7 @@ pseudo_dump_data(char *name, const void *v, size_t len) { } *hexptr = '\0'; *asciiptr = '\0'; - pseudo_diag("0x%06x %-50.50s '%.16s'\n", + pseudo_info("0x%06x %-50.50s '%.16s'\n", (int) (data - base), hexbuf, asciibuf); remaining = remaining - 16; From patchwork Wed Jun 10 11:46:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Sakhonchik X-Patchwork-Id: 89659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 093BBCD8CB2 for ; Wed, 10 Jun 2026 11:46:46 +0000 (UTC) Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18624.1781092001781016565 for ; Wed, 10 Jun 2026 04:46:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=SgbKTy2i; spf=pass (domain: gmail.com, ip: 209.85.208.50, mailfrom: frezidok1@gmail.com) Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-68d233bf083so9506280a12.1 for ; Wed, 10 Jun 2026 04:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781092000; x=1781696800; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ffi7ZbbC0lnjyYhJRmXhZcMvrCFNiqp6++NPyTYQJX8=; b=SgbKTy2ivmeg8NyafbnECpDhhc/V/2VC7H8XCGUBduNWbNgcxHfM/R7QJiRt6kZe2w blqQGxzJV21YAR3N3Bfx/BZGamZVEHTFj6PRdn9PjzvM1lUFdpCIzPJSP4p6zG2gMVpk 5S+z89SWXefp3piOdCFfopD3l9lLcj1Xdm1hzEo18CYhnfcJT2IIWW11srp83mbNm/34 BsXLjiPxi+kHAmeZA3niRT4FZngPdf1j1Urlx9XvtzZ0ZC6TyTqOE0Jrq6TNQ7vIWb+F rdhVBBuFDvMnZXAZe7W6H6y1B6TQ5v1K8GdHcAz308XUNMi6P3BWg7F+JnFEG4mYRrCQ Zc8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781092000; x=1781696800; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ffi7ZbbC0lnjyYhJRmXhZcMvrCFNiqp6++NPyTYQJX8=; b=hNIkTLuG73508rzM4GBm/GaxnqEMJqQX1C5aMSQEwFi0YdTZlrOgw1YJc/ArDsWgUm l9pAaYKiOywkwhpmmPurCTESpiTQEhJqO/XrRBeqQWyXnauB8jaVwl1lGcmkjtnwfl1R KkWvbgcGxIJ1zILIDCZClkcLU7lEBDsWNNq/vebsSNgoPNz5Jm28vxXxSgQJ4Jd25Gyr hlh68ogbaA7/KqINbrkOXKqfOQjPE7Dl4PxG4dJqPJ00IW12A7V7DRD5EopTYkcAi61f tgbF+3ICrkhslGRSMR01v8I4DNQ6ntuNxP3P8iNMn1bz79IMruNQyurL0GBi0gvDb6aB +unQ== X-Gm-Message-State: AOJu0Yx8K5GlQHGu5oQu93bk4AuSXysl2pYyKgxIAc8PvoGLXdoycYXo Z8m6W5F3q2q0LL/VPj45Q8ZT9RzCg3T/lnwBZ82HiyLYu6RjFFsv6n4HtEcI3w19 X-Gm-Gg: Acq92OEvMmiABHtG41DoUbsaBl26WakY2ZE4y8PIVXobRdw3k+XSm2SqEZ0U5QB8rLM 7lWkNBMuNH/3HlXHN+QZ1TYLJpYPdlYv42tckdKQg8wkw1hSXjrS0TuusVl1q+KzrRcMALguHo1 srNbJdW4T+hSCqwMRmfIWJAmw5a/6rhAEWWk+pOHvLIYSPV2O9CyGp9ovxXF8qKC0w3NJaNv4DM FkHVLSpg9oeufR9HVvhWrY9RA+w9JYszKxGo/cPLF3vvJ0bJkygqDHWLYGmDxsYVtPcCcCUJszx vRyqB9R8AU0VXTidOzJ9qjvmJGYJxRic1YAoKt6k1Q06MwNM8PvPcG12GzbYZEJO9UqAcz4tbpu Hie+1X6kslAWdux4SVIAnyomt+vYVvS8eVZ5EcorCbf+ksGuYx5UUOqB32Om6ehEkNk9UbjyXbR c6h6qUEKxqJfa59vdap7aGf2BHcUrYANdgfhhxLLk= X-Received: by 2002:a05:6402:e86:b0:68c:bf82:8844 with SMTP id 4fb4d7f45d1cf-68fa4c24a12mr11420003a12.6.1781091999692; Wed, 10 Jun 2026 04:46:39 -0700 (PDT) Received: from ubuntu1.. ([194.87.83.187]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6912faea64dsm5997164a12.19.2026.06.10.04.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2026 04:46:39 -0700 (PDT) From: frezidok1@gmail.com To: yocto-patches@lists.yoctoproject.org Cc: Dmitry Sakhonchik Subject: [pseudo] [PATCH 2/8] pseudo_db: Change pseudo_diag() calls to appropriate macros Date: Wed, 10 Jun 2026 14:46:04 +0300 Message-ID: <20260610114610.60776-2-frezidok1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260610114610.60776-1-frezidok1@gmail.com> References: <20260610114610.60776-1-frezidok1@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 10 Jun 2026 11:46:46 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/4193 From: Dmitry Sakhonchik Implements [YOCTO #12141] Signed-off-by: Dmitry Sakhonchik --- pseudo_db.c | 122 ++++++++++++++++++++++++++-------------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/pseudo_db.c b/pseudo_db.c index 6a33f20..6945a83 100644 --- a/pseudo_db.c +++ b/pseudo_db.c @@ -27,7 +27,7 @@ #ifdef NPROFILE void xProfile(void * pArg, const char * pQuery, sqlite3_uint64 pTimeTaken) { - pseudo_diag("profile: %lld %s\n", pTimeTaken, pQuery); + pseudo_info("profile: %lld %s\n", pTimeTaken, pQuery); } #endif @@ -647,7 +647,7 @@ cleanup_db(void) { localtime_r(&stamp.tv_sec, &stamp_tm); strftime(datebuf, 64, "%H:%M:%S", &stamp_tm); - pseudo_diag("db cleanup for server shutdown, %s.%03d\n", + pseudo_info("db cleanup for server shutdown, %s.%03d\n", datebuf, (int) (stamp.tv_usec / 1000)); #ifdef USE_MEMORY_DB if (real_file_db) { @@ -657,7 +657,7 @@ cleanup_db(void) { gettimeofday(&stamp, NULL); localtime_r(&stamp.tv_sec, &stamp_tm); strftime(datebuf, 64, "%H:%M:%S", &stamp_tm); - pseudo_diag("memory-to-file backup complete, %s.%03d.\n", + pseudo_info("memory-to-file backup complete, %s.%03d.\n", datebuf, (int) (stamp.tv_usec / 1000)); #endif if (file_db) @@ -667,7 +667,7 @@ cleanup_db(void) { gettimeofday(&stamp, NULL); localtime_r(&stamp.tv_sec, &stamp_tm); strftime(datebuf, 64, "%H:%M:%S", &stamp_tm); - pseudo_diag("db cleanup finished, %s.%03d\n", + pseudo_info("db cleanup finished, %s.%03d\n", datebuf, (int) (stamp.tv_usec / 1000)); } @@ -704,7 +704,7 @@ get_db(struct database_info *dbinfo) { rc = sqlite3_open(dbfile, &db); free(dbfile); if (rc) { - pseudo_diag("Failed: %s\n", sqlite3_errmsg(db)); + pseudo_error("Failed: %s\n", sqlite3_errmsg(db)); sqlite3_close(db); *(dbinfo->db) = NULL; return 1; @@ -733,7 +733,7 @@ get_db(struct database_info *dbinfo) { "ORDER BY name;"; rc = sqlite3_get_table(db, sql, &results, &rows, &columns, &errmsg); if (rc) { - pseudo_diag("Failed: %s\n", errmsg); + pseudo_error("Failed: %s\n", errmsg); } else { rc = make_tables(db, dbinfo->tables, dbinfo->indexes, dbinfo->migrations, results, rows); sqlite3_free_table(results); @@ -760,7 +760,7 @@ get_dbs(void) { #endif for (i = 0; db_infos[i].db; ++i) { if (get_db(&db_infos[i])) { - pseudo_diag("Error getting '%s' database.\n", + pseudo_error("Error getting '%s' database.\n", db_infos[i].pathname); err = 1; } @@ -780,12 +780,12 @@ pdb_log_traits(pseudo_query_t *traits) { int rc; if (!log_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 1; } e = calloc(1, sizeof(*e)); if (!e) { - pseudo_diag("can't allocate space for log entry."); + pseudo_error("can't allocate space for log entry."); return 1; } for (trait = traits; trait; trait = trait->next) { @@ -854,7 +854,7 @@ pdb_log_traits(pseudo_query_t *traits) { case PSQF_ID: case PSQF_ORDER: default: - pseudo_diag("Invalid trait %s for log creation.\n", + pseudo_error("Invalid trait %s for log creation.\n", pseudo_query_field_name(trait->field)); free(e); return 1; @@ -878,7 +878,7 @@ pdb_log_entry(log_entry *e) { int rc; if (!log_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 1; } @@ -976,7 +976,7 @@ pdb_log_msg(pseudo_sev_t severity, pseudo_msg_t *msg, const char *program, const } if (!log_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 1; } @@ -1062,7 +1062,7 @@ frag(buffer *b, char *fmt, ...) { int rc; if (!b) { - pseudo_diag("frag called without buffer.\n"); + pseudo_error("frag called without buffer.\n"); return -1; } curlen = b->tail - b->data; @@ -1075,7 +1075,7 @@ frag(buffer *b, char *fmt, ...) { newlen *= 2; char *newbuf = malloc(newlen); if (!newbuf) { - pseudo_diag("failed to allocate SQL buffer.\n"); + pseudo_error("failed to allocate SQL buffer.\n"); return -1; } memcpy(newbuf, b->data, curlen + 1); @@ -1088,7 +1088,7 @@ frag(buffer *b, char *fmt, ...) { rc = vsnprintf(b->tail, b->buflen - curlen, fmt, ap); va_end(ap); if ((rc > 0) && ((size_t) rc >= (b->buflen - curlen))) { - pseudo_diag("tried to reallocate larger buffer, failed. giving up.\n"); + pseudo_error("tried to reallocate larger buffer, failed. giving up.\n"); return -1; } } @@ -1110,24 +1110,24 @@ pdb_query(char *stmt_type, pseudo_query_t *traits, unsigned long fields, int uni static buffer *sql; if (!log_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return NULL; } if (!stmt_type) { - pseudo_diag("can't prepare a statement without a type.\n"); + pseudo_warning("can't prepare a statement without a type.\n"); } if (!sql) { sql = malloc(sizeof *sql); if (!sql) { - pseudo_diag("can't allocate SQL buffer.\n"); + pseudo_error("can't allocate SQL buffer.\n"); return NULL; } sql->buflen = 512; sql->data = malloc(sql->buflen); if (!sql->data) { - pseudo_diag("can't allocate SQL text buffer.\n"); + pseudo_error("can't allocate SQL text buffer.\n"); free(sql); sql = 0; return NULL; @@ -1193,7 +1193,7 @@ pdb_query(char *stmt_type, pseudo_query_t *traits, unsigned long fields, int uni case PSQT_LIKE: case PSQT_NOTLIKE: case PSQT_SQLPAT: - pseudo_diag("Error: Can't use a LIKE match on non-text fields.\n"); + pseudo_error("Can't use a LIKE match on non-text fields.\n"); return 0; break; default: @@ -1210,7 +1210,7 @@ pdb_query(char *stmt_type, pseudo_query_t *traits, unsigned long fields, int uni case PSQT_LIKE: case PSQT_NOTLIKE: case PSQT_SQLPAT: - pseudo_diag("Error: Can't use a LIKE match on non-text fields.\n"); + pseudo_error("Error: Can't use a LIKE match on non-text fields.\n"); return 0; break; default: @@ -1235,7 +1235,7 @@ pdb_query(char *stmt_type, pseudo_query_t *traits, unsigned long fields, int uni order_dir = "ASC"; break; default: - pseudo_diag("Ordering must be < or >.\n"); + pseudo_error("Ordering must be < or >.\n"); return 0; break; } @@ -1245,7 +1245,7 @@ pdb_query(char *stmt_type, pseudo_query_t *traits, unsigned long fields, int uni case PSQT_LIKE: case PSQT_NOTLIKE: case PSQT_SQLPAT: - pseudo_diag("Error: Can't use a LIKE match on non-text fields.\n"); + pseudo_error("Can't use a LIKE match on non-text fields.\n"); return 0; break; default: @@ -1300,7 +1300,7 @@ pdb_query(char *stmt_type, pseudo_query_t *traits, unsigned long fields, int uni sqlite3_bind_int64(stmt, field++, trait->data.ivalue); break; default: - pseudo_diag("Inexplicably invalid field type %d\n", trait->field); + pseudo_error("Inexplicably invalid field type %d\n", trait->field); sqlite3_finalize(stmt); return NULL; } @@ -1322,7 +1322,7 @@ pdb_delete(pseudo_query_t *traits, unsigned long fields) { dberr(log_db, "deletion failed"); return -1; } else { - pseudo_diag("Deleted records, vacuuming log database (may take a while).\n"); + pseudo_info("Deleted records, vacuuming log database (may take a while).\n"); /* we can't do anything about it if this fails... */ sqlite3_exec(log_db, "VACUUM;", NULL, NULL, NULL); } @@ -1347,7 +1347,7 @@ pdb_history(pseudo_query_t *traits, unsigned long fields, int unique) { h->fields = fields; h->stmt = stmt; } else { - pseudo_diag("failed to allocate memory for log_history\n"); + pseudo_error("failed to allocate memory for log_history\n"); sqlite3_finalize(stmt); } return h; @@ -1378,7 +1378,7 @@ pdb_history_entry(log_history h) { } l = calloc(1, sizeof(log_entry)); if (!l) { - pseudo_diag("couldn't allocate log entry.\n"); + pseudo_error("couldn't allocate log entry.\n"); return 0; } @@ -1449,12 +1449,12 @@ pdb_history_entry(log_history h) { case PSQF_ORDER: case PSQF_FTYPE: case PSQF_PERM: - pseudo_diag("field %s should not be in the fields list.\n", + pseudo_warning("field %s should not be in the fields list.\n", pseudo_query_field_name(f)); return 0; break; default: - pseudo_diag("unknown field %d\n", f); + pseudo_warning("unknown field %d\n", f); return 0; break; } @@ -1498,7 +1498,7 @@ pdb_clear_unused_xattrs(void) { int rc; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return; } if (!delete) { @@ -1528,7 +1528,7 @@ pdb_clear_xattrs(pseudo_msg_t *msg) { if (!msg) return; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return; } if (!delete) { @@ -1565,7 +1565,7 @@ pdb_copy_xattrs(pseudo_msg_t *oldmsg, pseudo_msg_t *msg) { if (!oldmsg || !msg) return; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return; } if (!copy) { @@ -1596,7 +1596,7 @@ pdb_check_xattrs(pseudo_msg_t *msg) { if (!msg) return; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return; } if (!scan) { @@ -1643,7 +1643,7 @@ pdb_link_file(pseudo_msg_t *msg) { " VALUES (?, ?, ?, ?, ?, ?, ?, 0);"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!insert) { @@ -1689,7 +1689,7 @@ pdb_unlink_file_dev(pseudo_msg_t *msg) { char *sql = "DELETE FROM files WHERE dev = ? AND ino = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!sql_delete) { @@ -1724,7 +1724,7 @@ pdb_update_file_path(pseudo_msg_t *msg) { "WHERE path = 'NAMELESS FILE' and dev = ? AND ino = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!update) { @@ -1759,7 +1759,7 @@ pdb_may_unlink_file(pseudo_msg_t *msg, int deleting) { char *sql_mark_file = "UPDATE files SET deleting = ? WHERE path = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!mark_file) { @@ -1804,7 +1804,7 @@ pdb_cancel_unlink_file(pseudo_msg_t *msg) { char *sql_mark_file = "UPDATE files SET deleting = 0 WHERE path = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!mark_file) { @@ -1846,7 +1846,7 @@ pdb_did_unlink_files(int deleting) { char *sql_delete_exact = "DELETE FROM files WHERE deleting = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!delete_exact) { @@ -1857,7 +1857,7 @@ pdb_did_unlink_files(int deleting) { } } if (deleting == 0) { - pseudo_diag("did_unlink_files: deleting must be non-zero.\n"); + pseudo_error("did_unlink_files: deleting must be non-zero.\n"); return 0; } sqlite3_bind_int(delete_exact, 1, deleting); @@ -1882,7 +1882,7 @@ pdb_did_unlink_file(char *path, pseudo_msg_t *msg, int deleting) { char *sql_delete_exact = "DELETE FROM files WHERE path = ? AND deleting = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!delete_exact) { @@ -1925,7 +1925,7 @@ pdb_unlink_file(pseudo_msg_t *msg) { char *sql_delete_exact = "DELETE FROM files WHERE path = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!delete_exact) { @@ -1973,7 +1973,7 @@ pdb_unlink_contents(pseudo_msg_t *msg) { "(path > (? || '/') AND path < (? || '0'));"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!delete_sub) { @@ -2025,7 +2025,7 @@ pdb_rename_file(const char *oldpath, pseudo_msg_t *msg) { "WHERE (path > (? || '/') AND path < (? || '0'));"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!update_exact) { @@ -2098,7 +2098,7 @@ pdb_renumber_all(dev_t from, dev_t to) { " WHERE dev = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!files_update) { @@ -2166,7 +2166,7 @@ pdb_update_inode(pseudo_msg_t *msg) { if (!oldmsg) { oldmsg = malloc(sizeof(*msg) + pseudo_path_max()); if (!oldmsg) { - pseudo_diag("%s: out of memory\n", __func__); + pseudo_error("%s: out of memory\n", __func__); return 1; } } @@ -2175,7 +2175,7 @@ pdb_update_inode(pseudo_msg_t *msg) { " SET dev = ?, ino = ? " " WHERE path = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!update) { @@ -2189,7 +2189,7 @@ pdb_update_inode(pseudo_msg_t *msg) { return 1; } if (!msg->pathlen) { - pseudo_diag("Can't update the inode of a file without its path.\n"); + pseudo_error("Can't update the inode of a file without its path.\n"); return 1; } memcpy(oldmsg, msg, sizeof(*msg) + msg->pathlen); @@ -2240,7 +2240,7 @@ pdb_update_file(pseudo_msg_t *msg) { " WHERE dev = ? AND ino = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!update) { @@ -2281,7 +2281,7 @@ pdb_find_file_exact(pseudo_msg_t *msg) { char *sql = "SELECT * FROM files WHERE path = ? AND dev = ? AND ino = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!select) { @@ -2332,7 +2332,7 @@ pdb_find_file_path(pseudo_msg_t *msg) { char *sql = "SELECT * FROM files WHERE path = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 1; } if (!select) { @@ -2389,7 +2389,7 @@ pdb_get_file_path(pseudo_msg_t *msg) { char *response; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!select) { @@ -2438,7 +2438,7 @@ pdb_find_file_dev(pseudo_msg_t *msg, char **path) { char *sql = "SELECT * FROM files WHERE dev = ? AND ino = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!select) { @@ -2492,7 +2492,7 @@ pdb_get_xattr(pseudo_msg_t *msg, char **value, size_t *len) { char *sql = "SELECT value FROM xattrs WHERE dev = ? AND ino = ? AND name = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!select) { @@ -2523,7 +2523,7 @@ pdb_get_xattr(pseudo_msg_t *msg, char **value, size_t *len) { */ *value = malloc(length); if (!*value) { - pseudo_diag("%s: out of memory\n", __func__); + pseudo_error("%s: out of memory\n", __func__); sqlite3_reset(select); sqlite3_clear_bindings(select); return 1; @@ -2561,7 +2561,7 @@ pdb_list_xattr(pseudo_msg_t *msg, char **value, size_t *len) { char *sql = "SELECT name FROM xattrs WHERE dev = ? AND ino = ? ORDER BY name;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!select) { @@ -2615,7 +2615,7 @@ pdb_remove_xattr(pseudo_msg_t *msg, char *value, size_t len) { char *sql = "DELETE FROM xattrs WHERE dev = ? AND ino = ? AND name = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!delete) { @@ -2656,7 +2656,7 @@ pdb_set_xattr(pseudo_msg_t *msg, char *value, size_t len, int flags) { size_t vlen; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!select) { @@ -2769,7 +2769,7 @@ pdb_find_file_ino(pseudo_msg_t *msg) { char *sql = "SELECT * FROM files WHERE ino = ?;"; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } if (!select) { @@ -2813,7 +2813,7 @@ pdb_files(void) { pdb_file_list l; if (!file_db && get_dbs()) { - pseudo_diag("%s: database error.\n", __func__); + pseudo_error("%s: database error.\n", __func__); return 0; } @@ -2852,7 +2852,7 @@ pdb_file(pdb_file_list l) { s = sqlite3_column_text(l->stmt, column++); m = pseudo_msg_new(0, (const char *) s); if (!m) { - pseudo_diag("couldn't allocate file message.\n"); + pseudo_error("couldn't allocate file message.\n"); return NULL; } pseudo_debug(PDBGF_DB, "pdb_file: '%s'\n", s ? (const char *) s : ""); From patchwork Wed Jun 10 11:46:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Sakhonchik X-Patchwork-Id: 89660 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09692CD8CB2 for ; Wed, 10 Jun 2026 11:46:56 +0000 (UTC) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18627.1781092013605110236 for ; Wed, 10 Jun 2026 04:46:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=lhMzKqfC; spf=pass (domain: gmail.com, ip: 209.85.208.46, mailfrom: frezidok1@gmail.com) Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-6912f4acca4so8841251a12.1 for ; Wed, 10 Jun 2026 04:46:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781092012; x=1781696812; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CMpahlxNluK3mG2+AuhkNJfiJLy4QPz8QwmwW9Gixyc=; b=lhMzKqfCw69ObmKV+4V1kc0PBtLc2xKUxnpwBjEjRMfUecucBnlFKUcFxll9/3Ns3Q kJ8akIxXy9iKwRryHOs65QNA2ybH+eTKn3ImwKm9fpFdnKy9xjZ09LmZthPIEXLi6yGj Mkf6I6JQmcYiXGsVgIQkXeG2G4eI+1/ijLoP62erk2v/uQxtJy/ICXRIl3lHs4ECfWFY 8jiM2ntqcUjWHkCR0WIlkqj4Ay1JjL2r5L57qNWHlpasDRdbijV33KlupgoljboZj3DV lDh1IPVWLF7SFfJ92aOnji7YtH3WHdqQKEN5vv//qyKtruU+374PPX2mUQ4r/gBa74j5 F4JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781092012; x=1781696812; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=CMpahlxNluK3mG2+AuhkNJfiJLy4QPz8QwmwW9Gixyc=; b=L6zjpf4DDH/4yuqXLADM9dv2swWsYkrj0k6JA+wApwxrV869/6sq+WUgARuuVEKDHd qT0QVi6LODATkY41PkLRveLRsFzPbsnZ3MzaToN6psOhMyAgF9DvBiQUUlIxVZoC6onk ZEVaJJMzoZ83UP3wjYPCaK159A4D8C2tuPDSNK0ZRCSEaBbGCYnYrdbCvsW2o3XXgHKR UKtZ9MGYyHGqVm86QOAYNpDHl+yqbmH4Eav3LKlOxVFFd8nP/ibSazMj2h1LoAgBy0wb 9/QtFk7nbz6uhS8hhq/4x3XD+/QkJxkl/3D0Jcyes/b4Xx+Pj318PiQHokxcBJBVHfis eTFQ== X-Gm-Message-State: AOJu0YzdfbygbjMhoLfPhQ5dicne7WycUFktNq2Ouv1RVzflFOLOfoy7 igZ1NjhiitSKmTt37HfI79Ie0SGZZj0zUMpUYe3lx1DlZGV8HipqFjJsYIXooGBl X-Gm-Gg: Acq92OGm/vPu1/x8aChgXiPFMjpc1c+y6E6SWp8bXKXqV6mDp2zF6CXmuG1MPygqXIJ /k5/oBXmPlemTMfO0wG3FvQJjKnveTksp/GpmfyuYIAtvuw+56V3K7xLgoPIJvN/IDHnVUZDCN9 Crh7i/U5MglJemgczWJlnTDzog6cg/NDEybK2JkB69a+EMPpN0yGbdwU+NNwvS/WHHvo9CHecxq IMkMNOnw52FAQbMC64plZtdBp62ASU8RdsyIlpJrhn9o+beHPk2v3s0dqVUTeH0oWlHzURnHiZD LgqvY3+b3dFH4HUm9g/tZD9TRv2NEIthEZFuK5UGeRt+FojONvM//Q4LrIP3/t/N3pZliQipuUE zNA+2/P/8yVVEN2w9Ei5eg5PPqjSQMlR4ANFH4oBjoOT9zEjCnPrJQgyVUkf7jaOegudl0S8CkF fGqvx8pQR3DZsk8qQMO0Gx4OLC/Tfm X-Received: by 2002:a05:6402:35d1:b0:68d:642b:3d4c with SMTP id 4fb4d7f45d1cf-68fa4d24321mr12683296a12.11.1781092011447; Wed, 10 Jun 2026 04:46:51 -0700 (PDT) Received: from ubuntu1.. ([194.87.83.187]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6912faea64dsm5997164a12.19.2026.06.10.04.46.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2026 04:46:50 -0700 (PDT) From: frezidok1@gmail.com To: yocto-patches@lists.yoctoproject.org Cc: Dmitry Sakhonchik Subject: [pseudo] [PATCH 3/8] pseudo_client: Change pseudo_diag() calls to appropriate macros Date: Wed, 10 Jun 2026 14:46:05 +0300 Message-ID: <20260610114610.60776-3-frezidok1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260610114610.60776-1-frezidok1@gmail.com> References: <20260610114610.60776-1-frezidok1@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 10 Jun 2026 11:46:56 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/4194 From: Dmitry Sakhonchik Implements [YOCTO #12141] Signed-off-by: Dmitry Sakhonchik --- pseudo_client.c | 96 ++++++++++++++++++++++++------------------------- 1 file changed, 47 insertions(+), 49 deletions(-) diff --git a/pseudo_client.c b/pseudo_client.c index 7041366..69e5cbc 100644 --- a/pseudo_client.c +++ b/pseudo_client.c @@ -166,7 +166,7 @@ build_passwd_paths(void) /* allocation and/or return */ if (passwd_paths) { if (np != npasswd_paths) { - pseudo_diag("internal error: path allocation was inconsistent.\n"); + pseudo_error("internal error: path allocation was inconsistent.\n"); } else { /* yes, we allocated one extra for a trailing * null pointer. @@ -178,14 +178,14 @@ build_passwd_paths(void) passwd_paths = malloc((np + 1) * sizeof(*passwd_paths)); npasswd_paths = np; if (!passwd_paths) { - pseudo_diag("couldn't allocate storage for password paths.\n"); + pseudo_error("couldn't allocate storage for password paths.\n"); exit(1); } np = 0; } } while (++pass < 2); /* in theory the second pass already returned, but. */ - pseudo_diag("should totally not have gotten here.\n"); + pseudo_error("should totally not have gotten here.\n"); return; } @@ -567,11 +567,11 @@ pseudo_init_client(void) { } pseudo_prefix_dir_fd = pseudo_fd(pseudo_prefix_dir_fd, MOVE_FD); } else { - pseudo_diag("No prefix available to to find server.\n"); + pseudo_error("No prefix available to to find server.\n"); exit(1); } if (pseudo_prefix_dir_fd == -1) { - pseudo_diag("Can't open prefix path '%s' for server: %s\n", + pseudo_error("Can't open prefix path '%s' for server: %s\n", pseudo_path, strerror(errno)); exit(1); @@ -590,11 +590,11 @@ pseudo_init_client(void) { } pseudo_localstate_dir_fd = pseudo_fd(pseudo_localstate_dir_fd, MOVE_FD); } else { - pseudo_diag("No local state directory available for server/file interactions.\n"); + pseudo_error("No local state directory available for server/file interactions.\n"); exit(1); } if (pseudo_localstate_dir_fd == -1) { - pseudo_diag("Can't open local state path '%s': %s\n", + pseudo_error("Can't open local state path '%s': %s\n", pseudo_path, strerror(errno)); exit(1); @@ -633,7 +633,7 @@ pseudo_init_client(void) { if (pseudo_chroot) { pseudo_chroot_len = strlen(pseudo_chroot); } else { - pseudo_diag("Can't store chroot path '%s'\n", env); + pseudo_error("Can't store chroot path '%s'\n", env); } } free(env); @@ -662,7 +662,7 @@ pseudo_init_client(void) { static void pseudo_file_close(int *fd, FILE **fp) { if (!fp || !fd) { - pseudo_diag("pseudo_file_close: needs valid pointers.\n"); + pseudo_error("pseudo_file_close: needs valid pointers.\n"); return; } pseudo_antimagic(); @@ -698,7 +698,7 @@ pseudo_file_close(int *fd, FILE **fp) { static FILE * pseudo_file_open(char *name, int *fd, FILE **fp) { if (!fp || !fd || !name) { - pseudo_diag("pseudo_file_open: needs valid pointers.\n"); + pseudo_error("pseudo_file_open: needs valid pointers.\n"); return NULL; } pseudo_file_close(fd, fp); @@ -734,7 +734,7 @@ pseudo_pwd_lck_open(void) { if (!pseudo_pwd_lck_name) { pseudo_pwd_lck_name = malloc(pseudo_path_max()); if (!pseudo_pwd_lck_name) { - pseudo_diag("couldn't allocate space for passwd lockfile path.\n"); + pseudo_error("couldn't allocate space for passwd lockfile path.\n"); return -1; } } @@ -815,7 +815,7 @@ pseudo_client_chroot(const char *path) { pseudo_chroot_len = strlen(path); pseudo_chroot = malloc(pseudo_chroot_len + 1); if (!pseudo_chroot) { - pseudo_diag("Couldn't allocate chroot directory buffer.\n"); + pseudo_error("Couldn't allocate chroot directory buffer.\n"); pseudo_chroot_len = 0; errno = ENOMEM; return -1; @@ -834,7 +834,7 @@ pseudo_root_path(const char *func, int line, int dirfd, const char *path, int le rc = base_path(dirfd, path, leave_last); pseudo_magic(); if (!rc) { - pseudo_diag("couldn't allocate absolute path for '%s'.\n", + pseudo_error("couldn't allocate absolute path for '%s'.\n", path ? path : "null"); } pseudo_debug(PDBGF_CHROOT, "root_path [%s, %d]: '%s' from '%s'\n", @@ -849,7 +849,7 @@ pseudo_client_getcwd(void) { char *cwd; cwd = malloc(pseudo_path_max()); if (!cwd) { - pseudo_diag("Can't allocate CWD buffer!\n"); + pseudo_error("Can't allocate CWD buffer!\n"); return -1; } pseudo_debug(PDBGF_CLIENT | PDBGF_VERBOSE, "getcwd: trying to find cwd.\n"); @@ -874,7 +874,7 @@ pseudo_client_getcwd(void) { } return 0; } else { - pseudo_diag("Can't get CWD: %s\n", strerror(errno)); + pseudo_error("Can't get CWD: %s\n", strerror(errno)); return -1; } } @@ -901,7 +901,7 @@ pseudo_client_path_set(int fd, const char *path, char ***patharray, int *len) { *len, fd + 1); (*patharray) = realloc((*patharray), (fd + 1) * sizeof(char *)); if (!*patharray) { - pseudo_diag("couldn't realloc fd path array to %ld entries\n", (fd + 1) * sizeof(char *)); + pseudo_error("couldn't realloc fd path array to %ld entries\n", (fd + 1) * sizeof(char *)); exit(1); } for (i = *len; i < fd + 1; ++i) @@ -1002,7 +1002,7 @@ client_spawn_server(void) { if ((server_pid = pseudo_real_fork()) != 0) { if (server_pid == -1) { - pseudo_diag("couldn't fork server: %s\n", strerror(errno)); + pseudo_error("couldn't fork server: %s\n", strerror(errno)); return 1; } pseudo_evlog(PDBGF_CLIENT, "spawned new server, pid %d\n", server_pid); @@ -1109,7 +1109,7 @@ client_spawn_server(void) { pseudo_setupenv(); pseudo_dropenv(); pseudo_real_execv(argv[0], argv); - pseudo_diag("critical failure: exec of pseudo daemon failed: %s\n", strerror(errno)); + pseudo_error("critical failure: exec of pseudo daemon failed: %s\n", strerror(errno)); exit(1); } } @@ -1187,7 +1187,7 @@ pseudo_fd(int fd, int how) { /* Set close on exec, even if we didn't move it. */ if ((newfd >= 0) && (fcntl(newfd, F_SETFD, FD_CLOEXEC) < 0)) - pseudo_diag("Can't set close on exec flag: %s\n", + pseudo_error("Can't set close on exec flag: %s\n", strerror(errno)); return(newfd); @@ -1208,7 +1208,7 @@ client_connect(void) { pseudo_evlog(PDBGF_CLIENT, "creating socket %s.\n", sun.sun_path); if (connect_fd == -1) { char *e = strerror(errno); - pseudo_diag("Can't create socket: %s (%s)\n", sun.sun_path, e); + pseudo_error("Can't create socket: %s (%s)\n", sun.sun_path, e); pseudo_evlog(PDBGF_CLIENT, "failed to create socket: %s\n", e); return 1; } @@ -1216,14 +1216,14 @@ client_connect(void) { pseudo_debug(PDBGF_CLIENT, "connecting socket...\n"); cwd_fd = open(".", O_RDONLY); if (cwd_fd == -1) { - pseudo_diag("Couldn't stash directory before opening socket: %s", + pseudo_error("Couldn't stash directory before opening socket: %s", strerror(errno)); close(connect_fd); connect_fd = -1; return 1; } if (fchdir(pseudo_localstate_dir_fd) == -1) { - pseudo_diag("Couldn't chdir to server directory [%d]: %s\n", + pseudo_error("Couldn't chdir to server directory [%d]: %s\n", pseudo_localstate_dir_fd, strerror(errno)); close(connect_fd); close(cwd_fd); @@ -1236,7 +1236,7 @@ client_connect(void) { pseudo_evlog(PDBGF_CLIENT, "connect failed: %s\n", e); close(connect_fd); if (fchdir(cwd_fd) == -1) { - pseudo_diag("return to previous directory failed: %s\n", + pseudo_error("return to previous directory failed: %s\n", strerror(errno)); } close(cwd_fd); @@ -1244,7 +1244,7 @@ client_connect(void) { return 1; } if (fchdir(cwd_fd) == -1) { - pseudo_diag("return to previous directory failed: %s\n", + pseudo_error("return to previous directory failed: %s\n", strerror(errno)); } close(cwd_fd); @@ -1402,11 +1402,9 @@ pseudo_client_request(pseudo_msg_t *msg, size_t len, const char *path) { } } } - pseudo_diag("pseudo: server connection persistently failed, aborting.\n"); + pseudo_error("pseudo: server connection persistently failed, aborting.\n"); pseudo_evlog_dump(); - pseudo_diag("event log dumped, aborting.\n"); - abort(); - pseudo_diag("aborted.\n"); + pseudo_critical("event log dumped, aborting.\n"); return 0; } @@ -1430,11 +1428,11 @@ pseudo_client_shutdown(int wait_on_socket) { pseudo_prefix_dir_fd = pseudo_fd(pseudo_prefix_dir_fd, COPY_FD); free(pseudo_path); } else { - pseudo_diag("No prefix available to to find server.\n"); + pseudo_error("No prefix available to to find server.\n"); exit(1); } if (pseudo_prefix_dir_fd == -1) { - pseudo_diag("Can't open prefix path (%s) for server. (%s)\n", + pseudo_error("Can't open prefix path (%s) for server. (%s)\n", pseudo_prefix_path(NULL), strerror(errno)); exit(1); @@ -1454,11 +1452,11 @@ pseudo_client_shutdown(int wait_on_socket) { pseudo_localstate_dir_fd = pseudo_fd(pseudo_localstate_dir_fd, COPY_FD); free(pseudo_path); } else { - pseudo_diag("No prefix available to to find server.\n"); + pseudo_error("No prefix available to to find server.\n"); exit(1); } if (pseudo_localstate_dir_fd == -1) { - pseudo_diag("Can't open local state path (%s) for server. (%s)\n", + pseudo_error("Can't open local state path (%s) for server. (%s)\n", pseudo_localstatedir_path(NULL), strerror(errno)); exit(1); @@ -1479,13 +1477,13 @@ pseudo_client_shutdown(int wait_on_socket) { } ack = pseudo_msg_receive(connect_fd); if (!ack) { - pseudo_diag("server did not respond to shutdown query.\n"); + pseudo_error("server did not respond to shutdown query.\n"); return 1; } if (ack->type != PSEUDO_MSG_ACK) { - pseudo_diag("Server refused shutdown. Remaining client fds: %d\n", ack->fd); - pseudo_diag("Client pids: %s\n", ack->path); - pseudo_diag("Server will shut down after all clients exit.\n"); + pseudo_info("Server refused shutdown. Remaining client fds: %d\n", ack->fd); + pseudo_info("Client pids: %s\n", ack->path); + pseudo_info("Server will shut down after all clients exit.\n"); } if (wait_on_socket) { /* try to receive a message the server won't send; @@ -1520,14 +1518,14 @@ base_path(int dirfd, const char *path, int leave_last) { if (basepath) { baselen = strlen(basepath); } else { - pseudo_diag("got *at() syscall for unknown directory, fd %d\n", dirfd); + pseudo_error("got *at() syscall for unknown directory, fd %d\n", dirfd); } } else { basepath = pseudo_cwd; baselen = pseudo_cwd_len; } if (!basepath) { - pseudo_diag("unknown base path for fd %d, path %s\n", dirfd, path); + pseudo_error("unknown base path for fd %d, path %s\n", dirfd, path); return 0; } /* if there's a chroot path, and it's the start of basepath, @@ -1756,7 +1754,7 @@ pseudo_client_op(pseudo_op_t op, int access, int fd, int dirfd, const char *path if (op == OP_RENAME) { va_list ap; if (!path) { - pseudo_diag("rename (%s) without new path.\n", + pseudo_warning("rename (%s) without new path.\n", path ? path : ""); pseudo_magic(); return 0; @@ -1766,7 +1764,7 @@ pseudo_client_op(pseudo_op_t op, int access, int fd, int dirfd, const char *path va_end(ap); /* last argument is the previous path of the file */ if (!path_extra_1) { - pseudo_diag("rename (%s) without old path.\n", + pseudo_warning("rename (%s) without old path.\n", path ? path : ""); pseudo_magic(); return 0; @@ -1835,7 +1833,7 @@ pseudo_client_op(pseudo_op_t op, int access, int fd, int dirfd, const char *path alloced_path = malloc(full_len); alloced_len = full_len; if (!alloced_path) { - pseudo_diag("Can't allocate space for paths for a rename operation. Sorry.\n"); + pseudo_error("Can't allocate space for paths for a rename operation. Sorry.\n"); alloced_len = 0; pseudo_magic(); return 0; @@ -1859,7 +1857,7 @@ pseudo_client_op(pseudo_op_t op, int access, int fd, int dirfd, const char *path alloced_path = malloc(pathlen); alloced_len = pathlen; if (!alloced_path) { - pseudo_diag("Can't allocate space for paths for a rename operation. Sorry.\n"); + pseudo_error("Can't allocate space for paths for a rename operation. Sorry.\n"); alloced_len = 0; pseudo_magic(); return 0; @@ -1965,7 +1963,7 @@ pseudo_client_op(pseudo_op_t op, int access, int fd, int dirfd, const char *path if (fd == connect_fd) { connect_fd = pseudo_fd(connect_fd, COPY_FD); if (connect_fd == -1) { - pseudo_diag("tried to close connection, couldn't dup: %s\n", strerror(errno)); + pseudo_error("tried to close connection, couldn't dup: %s\n", strerror(errno)); } } else if (fd == pseudo_util_debug_fd) { pseudo_util_debug_fd = pseudo_fd(fd, COPY_FD); @@ -2037,7 +2035,7 @@ pseudo_client_op(pseudo_op_t op, int access, int fd, int dirfd, const char *path do_request = 1; break; default: - pseudo_diag("error: unknown or unimplemented operator %d (%s)", op, pseudo_op_name(op)); + pseudo_error("unknown or unimplemented operator %d (%s)", op, pseudo_op_name(op)); break; } /* result can only be set when PSEUDO_XATTRDB resulted in a @@ -2069,7 +2067,7 @@ pseudo_client_op(pseudo_op_t op, int access, int fd, int dirfd, const char *path pseudo_debug(PDBGF_OP, "(%d) %s", getpid(), pseudo_res_name(result->result)); if (result->result == RESULT_ABORT) { char *local_state_dir = pseudo_get_value("PSEUDO_LOCALSTATEDIR"); - pseudo_diag("abort()ing pseudo client by server request. See https://wiki.yoctoproject.org/wiki/Pseudo_Abort for more details on this.\n" + pseudo_info("abort()ing pseudo client by server request. See https://wiki.yoctoproject.org/wiki/Pseudo_Abort for more details on this.\n" "Check logfile: %s/%s\n", local_state_dir, PSEUDO_LOGFILE); abort(); } @@ -2149,13 +2147,13 @@ populate_path_segs(void) { } path_segs = malloc((c+2) * sizeof(*path_segs)); if (!path_segs) { - pseudo_diag("warning: failed to allocate space for %d path segments.\n", + pseudo_warning("failed to allocate space for %d path segments.\n", c); return; } path_lens = malloc((c + 2) * sizeof(*path_lens)); if (!path_lens) { - pseudo_diag("warning: failed to allocate space for %d path lengths.\n", + pseudo_warning("failed to allocate space for %d path lengths.\n", c); free(path_segs); path_segs = 0; @@ -2163,7 +2161,7 @@ populate_path_segs(void) { } previous_path_segs = strdup(previous_path); if (!previous_path_segs) { - pseudo_diag("warning: failed to allocate space for path copy.\n"); + pseudo_warning("failed to allocate space for path copy.\n"); free(path_segs); path_segs = NULL; free(path_lens); @@ -2242,7 +2240,7 @@ pseudo_exec_path(const char *filename, int search_path) { candidate = pseudo_fix_path(dir, filename, 0, len, NULL, 0); pseudo_debug(PDBGF_CLIENT, "exec_path: got %s for non-absolute path\n", candidate); } else { - pseudo_diag("couldn't allocate intermediate path.\n"); + pseudo_error("couldn't allocate intermediate path.\n"); candidate = NULL; } } From patchwork Wed Jun 10 11:46:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Sakhonchik X-Patchwork-Id: 89661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B38CCD8CB9 for ; Wed, 10 Jun 2026 11:47:06 +0000 (UTC) Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.18366.1781092022232140710 for ; Wed, 10 Jun 2026 04:47:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=gmooO63j; spf=pass (domain: gmail.com, ip: 209.85.208.44, mailfrom: frezidok1@gmail.com) Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-68852b58d87so12286826a12.3 for ; Wed, 10 Jun 2026 04:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781092021; x=1781696821; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uD8NZH+RLViO9p+BfgFN7spI7HIO6762HqFFIpPx1iI=; b=gmooO63jW/OqRg12TRr9Bq+EoKLu3MTBjrTKzUmOh8c+QJESyB7JSANQLEiO4cm6St 39pO9hBJiH8kgSZZGt23J5jL7cddpw0YCAn+yMr2ixt5OPiu1EYajAsOlchWmSd86xRK k8A7SjY4EG7Su7QJN44iEtZ3hhgjPB0+QrYQZz1WOLbmlgysa41MFp+KtNYa+5ZFg6bL iEr3p0JMaInhz/B7PpmHC8j38FPHH3b2mAJcQgJbGZUKuw5Zz8JyT6Bl+73qdW8epD8T PJXwKv5px6nOt/Rtsn0SCbjSqrjvkTl8WVHTq4tnYhauTvgdKwWmE8DbXs7O+YJZIfmW itDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781092021; x=1781696821; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=uD8NZH+RLViO9p+BfgFN7spI7HIO6762HqFFIpPx1iI=; b=K22ficaXiDcI+8/0ZlKj8J0lg3sBL4lZXmNKxoCUIFMaU76kEKViwC/JrCW960qcxn fOPe9MxZk8bCajybuB8pLp/Y0MXGJ+/zFtx8fZdxK+jF9XOD/ZR34tB0EorlOZ5batIx ZJIU6UnXlY84eMyGaU5jejg9NxW7z8D4/dtnit5IT9Do4mTgqo2ksYvl+eazWlv+7BPm KSHLhCNaqJVb8RcLhhzm4jicYbjSM8mZxtHzrq3HMnW33cjdKGPOdTMZ6qg8EZ2mdfNz MGyB0jP3p9EJRU0eBIZpm0d6sJuAQJZV2a0RU4P+iGWTC1bpk9QmbGF7b7ihcxxnCEZk hJVw== X-Gm-Message-State: AOJu0YxyXMgBUFlSDuJhSJgRTADR0IGtSlQvR5Qupsp2qVwTvhsuZaVX 27XLJ8n89yEhrl/Mg0DEHzIHw3eNps4mMh6TIVCK8fqLyv+8Ga4/ArIrL+Eb0sja X-Gm-Gg: Acq92OGspKF2DrtytVZjtcjOLPjC0EKHR9Xl0CIqtz9YG+2bpge5IIz4w5CAb2xX+Xy 0xEqvXQ6yPQyyDAb4FjLgiDlecpJV5ClTctDUntziiSjkN9AKjXEWHMEEyH8GrMLOngaomMFCkD TCIs/Qcd2FSnZOahZqm2NBG+HJZXsQXLwJ0gR3ep0OqqPM78JCGnc+HdN+WcCVN6Nk6Y5OG3wC5 xINCkTNRm2VmwHxVQExlNZ47N9J6DkuLzp4dk62cBgm+cFCXrBUVOEUUoA4U62c+EJdwSmxH+i4 4vGkXx8mug78PT00Wr88M64rvI2ma/Byop6T8Y2otOiQPD+lHJu9R7Y6/ReKZe5zPXHGooJ8Vdx qE+Zwrbe1+ltE85TkBGAKqRGIQPdeQZ0ejXyLw++tNUiOzG3P68+0j9gdPnaNNPVZyy+GehSrRb injxVXQesfQrNezVhp9IJvexpoUI3n X-Received: by 2002:a05:6402:4494:b0:692:4759:ac57 with SMTP id 4fb4d7f45d1cf-6924759aff8mr3646412a12.2.1781092020318; Wed, 10 Jun 2026 04:47:00 -0700 (PDT) Received: from ubuntu1.. ([194.87.83.187]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6912faea64dsm5997164a12.19.2026.06.10.04.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2026 04:46:59 -0700 (PDT) From: frezidok1@gmail.com To: yocto-patches@lists.yoctoproject.org Cc: Dmitry Sakhonchik Subject: [pseudo] [PATCH 4/8] pseudo_server: Change pseudo_diag() calls to appropriate macros Date: Wed, 10 Jun 2026 14:46:06 +0300 Message-ID: <20260610114610.60776-4-frezidok1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260610114610.60776-1-frezidok1@gmail.com> References: <20260610114610.60776-1-frezidok1@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 10 Jun 2026 11:47:06 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/4195 From: Dmitry Sakhonchik Implements [YOCTO #12141] Signed-off-by: Dmitry Sakhonchik --- pseudo_server.c | 92 ++++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/pseudo_server.c b/pseudo_server.c index edfbce1..c1a97c8 100644 --- a/pseudo_server.c +++ b/pseudo_server.c @@ -68,7 +68,7 @@ void pseudo_antimagic(void) { } void quit_now(int signal) { - pseudo_diag("Received signal %d, quitting.\n", signal); + pseudo_info("Received signal %d, quitting.\n", signal); die_forcefully = 1; } @@ -116,12 +116,12 @@ pseudo_server_write_pid(pid_t pid) { pseudo_path = pseudo_localstatedir_path(PSEUDO_PIDFILE); if (!pseudo_path) { - pseudo_diag("Couldn't get path for prefix/%s\n", PSEUDO_PIDFILE); + pseudo_error("Couldn't get path for prefix/%s\n", PSEUDO_PIDFILE); return 1; } fp = fopen(pseudo_path, "w"); if (!fp) { - pseudo_diag("Couldn't open %s: %s\n", + pseudo_error("Couldn't open %s: %s\n", pseudo_path, strerror(errno)); return 1; } @@ -171,7 +171,7 @@ pseudo_server_start(int daemonize) { pseudo_debug_logfile(PSEUDO_LOGFILE, 2); child = fork(); if (child == -1) { - pseudo_diag("Couldn't fork child process: %s\n", + pseudo_error("Couldn't fork child process: %s\n", strerror(errno)); exit(PSEUDO_EXIT_FORK_FAILED); } @@ -204,18 +204,18 @@ pseudo_server_start(int daemonize) { exit(0); } if (got_sigalrm) { - pseudo_diag("Child process timeout after %d seconds.\n", + pseudo_error("Child process timeout after %d seconds.\n", PSEUDO_CHILD_PROCESS_TIMEOUT); exit(PSEUDO_EXIT_TIMEOUT); } if (rc == -1) { - pseudo_diag("Failure in waitpid(): %s\n", + pseudo_error("Failure in waitpid(): %s\n", strerror(save_errno)); exit(PSEUDO_EXIT_WAITPID); } if (WIFSIGNALED(status)) { status = WTERMSIG(status); - pseudo_diag("Child process exited from signal %d.\n", + pseudo_error("Child process exited from signal %d.\n", status); kill(getpid(), status); /* can't use +128 because that's not valid */ @@ -223,15 +223,15 @@ pseudo_server_start(int daemonize) { } if (WIFEXITED(status)) { status = WEXITSTATUS(status); - pseudo_diag("Child process exit status %d: %s\n", + pseudo_error("Child process exit status %d: %s\n", status, pseudo_exit_status_name(status)); if (status == 0) { - pseudo_diag("Hang on, server should not have exited 0 without sending us sigusr1?\n"); + pseudo_error("Hang on, server should not have exited 0 without sending us sigusr1?\n"); } exit(status); } - pseudo_diag("Unknown exit status %d.\n", status); + pseudo_error("Unknown exit status %d.\n", status); exit(PSEUDO_EXIT_GENERAL); } else { /* detach from parent session */ @@ -245,24 +245,24 @@ pseudo_server_start(int daemonize) { } } - pseudo_diag("pid %d [parent %d], doing new pid setup and server start\n", getpid(), getppid()); + pseudo_info("pid %d [parent %d], doing new pid setup and server start\n", getpid(), getppid()); pseudo_new_pid(); pseudo_debug(PDBGF_SERVER, "opening lock.\n"); lockpath = pseudo_localstatedir_path(NULL); if (!lockpath) { - pseudo_diag("Couldn't allocate a file path.\n"); + pseudo_error("Couldn't allocate a file path.\n"); exit(PSEUDO_EXIT_LOCK_PATH); } mkdir_p(lockpath); lockname = pseudo_localstatedir_path(PSEUDO_LOCKFILE); if (!lockname) { - pseudo_diag("Couldn't allocate a file path.\n"); + pseudo_error("Couldn't allocate a file path.\n"); exit(PSEUDO_EXIT_LOCK_PATH); } lockfd = open(lockname, O_RDWR | O_CREAT, 0644); if (lockfd < 0) { - pseudo_diag("Can't open or create lockfile %s: %s\n", + pseudo_error("Can't open or create lockfile %s: %s\n", lockname, strerror(errno)); exit(PSEUDO_EXIT_LOCK_FAILED); } @@ -275,7 +275,7 @@ pseudo_server_start(int daemonize) { if (lockfd <= 2) { newfd = fcntl(lockfd, F_DUPFD, 3); if (newfd < 0) { - pseudo_diag("Can't move lockfile to safe descriptor, leaving it on %d: %s\n", + pseudo_warning("Can't move lockfile to safe descriptor, leaving it on %d: %s\n", lockfd, strerror(errno)); } else { close(lockfd); @@ -297,11 +297,11 @@ pseudo_server_start(int daemonize) { if (save_errno == EACCES || save_errno == EAGAIN) { rc = fcntl(lockfd, F_GETLK, &lock_data); if (rc == 0 && lock_data.l_type != F_UNLCK) { - pseudo_diag("lock already held by existing pid %d.\n", + pseudo_warning("lock already held by existing pid %d.\n", lock_data.l_pid); } } - pseudo_diag("Couldn't obtain lock: %s.\n", strerror(save_errno)); + pseudo_error("Couldn't obtain lock: %s.\n", strerror(save_errno)); exit(PSEUDO_EXIT_LOCK_HELD); } else { @@ -314,14 +314,14 @@ pseudo_server_start(int daemonize) { listen_fd = socket(PF_UNIX, SOCK_STREAM, 0); if (listen_fd < 0) { - pseudo_diag("couldn't create listening socket: %s\n", strerror(errno)); + pseudo_error("couldn't create listening socket: %s\n", strerror(errno)); exit(PSEUDO_EXIT_SOCKET_CREATE); } if (listen_fd <= 2) { newfd = fcntl(listen_fd, F_DUPFD, 3); if (newfd < 0) { - pseudo_diag("couldn't dup listening socket: %s\n", strerror(errno)); + pseudo_error("couldn't dup listening socket: %s\n", strerror(errno)); close(listen_fd); exit(PSEUDO_EXIT_SOCKET_FD); } else { @@ -333,7 +333,7 @@ pseudo_server_start(int daemonize) { /* cd to the data directory */ pseudo_path = pseudo_localstatedir_path(NULL); if (!pseudo_path || chdir(pseudo_path) == -1) { - pseudo_diag("can't get to '%s': %s\n", + pseudo_error("can't get to '%s': %s\n", pseudo_path, strerror(errno)); exit(PSEUDO_EXIT_SOCKET_PATH); } @@ -341,21 +341,21 @@ pseudo_server_start(int daemonize) { /* remove existing socket -- if it exists */ rc = unlink(sun.sun_path); if (rc == -1 && errno != ENOENT) { - pseudo_diag("Can't unlink existing socket: %s.\n", + pseudo_error("Can't unlink existing socket: %s.\n", strerror(errno)); exit(PSEUDO_EXIT_SOCKET_UNLINK); } if (bind(listen_fd, (struct sockaddr *) &sun, sizeof(sun)) == -1) { - pseudo_diag("couldn't bind listening socket: %s\n", strerror(errno)); + pseudo_error("couldn't bind listening socket: %s\n", strerror(errno)); exit(PSEUDO_EXIT_SOCKET_BIND); } if (listen(listen_fd, 5) == -1) { - pseudo_diag("couldn't listen on socket: %s\n", strerror(errno)); + pseudo_error("couldn't listen on socket: %s\n", strerror(errno)); exit(PSEUDO_EXIT_SOCKET_LISTEN); } rc = pseudo_server_write_pid(getpid()); if (rc != 0) { - pseudo_diag("warning: couldn't write pid file.\n"); + pseudo_warning("couldn't write pid file.\n"); } signal(SIGHUP, quit_now); signal(SIGINT, quit_now); @@ -366,9 +366,9 @@ pseudo_server_start(int daemonize) { if (daemonize) { pid_t ppid = getppid(); if (ppid == 1) { - pseudo_diag("Setup complete, but parent is init, not sending SIGUSR1.\n"); + pseudo_info("Setup complete, but parent is init, not sending SIGUSR1.\n"); } else { - pseudo_diag("Setup complete, sending SIGUSR1 to pid %d.\n", + pseudo_info("Setup complete, sending SIGUSR1 to pid %d.\n", ppid); kill(ppid, SIGUSR1); } @@ -424,7 +424,7 @@ open_client(int fd) { ++active_clients; return max_clients - 16; } else { - pseudo_diag("error allocating new client, fd %d\n", fd); + pseudo_error("error allocating new client, fd %d\n", fd); close(fd); return 0; } @@ -439,7 +439,7 @@ close_client(int client) { clients[client].pid, clients[client].fd); /* client went away... */ if (client > highest_client || client <= 0) { - pseudo_diag("tried to close client %d (highest is %d)\n", + pseudo_info("tried to close client %d (highest is %d)\n", client, highest_client); return; } @@ -559,7 +559,7 @@ serve_client(int i) { response_path = malloc(8 * active_clients); if (!response_path) { - pseudo_diag("out of memory allocating shutdown response\n"); + pseudo_error("out of memory allocating shutdown response\n"); exit(PSEUDO_EXIT_GENERAL); } else { memset(response_path, 0, 8 * active_clients); @@ -633,7 +633,7 @@ static void pseudo_server_loop_epoll(void) clients = malloc(16 * sizeof(*clients)); if (!clients) { - pseudo_diag("out of memory allocating client table.\n"); + pseudo_error("out of memory allocating client table.\n"); exit(PSEUDO_EXIT_LISTEN_FD); } @@ -655,7 +655,7 @@ static void pseudo_server_loop_epoll(void) pseudo_debug(PDBGF_SERVER, "server loop started.\n"); if (listen_fd < 0) { - pseudo_diag("got into loop with no valid listen fd.\n"); + pseudo_error("got into loop with no valid listen fd.\n"); exit(PSEUDO_EXIT_LISTEN_FD); } @@ -663,13 +663,13 @@ static void pseudo_server_loop_epoll(void) int epollfd = epoll_create1(0); if (epollfd == -1) { - pseudo_diag("epoll_create1() failed.\n"); + pseudo_error("epoll_create1() failed.\n"); exit(PSEUDO_EXIT_EPOLL_CREATE); } ev.events = EPOLLIN; ev.data.u64 = 0; if (epoll_ctl(epollfd, EPOLL_CTL_ADD, clients[0].fd, &ev) == -1) { - pseudo_diag("epoll_ctl() failed with listening socket.\n"); + pseudo_error("epoll_ctl() failed with listening socket.\n"); exit(PSEUDO_EXIT_EPOLL_CTL); } @@ -724,7 +724,7 @@ static void pseudo_server_loop_epoll(void) ev.events = EPOLLIN; ev.data.u64 = open_client(fd); if (ev.data.u64 != 0 && epoll_ctl(epollfd, EPOLL_CTL_ADD, clients[ev.data.u64].fd, &ev) == -1) { - pseudo_diag("epoll_ctl() failed with accepted socket.\n"); + pseudo_error("epoll_ctl() failed with accepted socket.\n"); exit(PSEUDO_EXIT_EPOLL_CTL); } } else if (errno == EMFILE) { @@ -746,22 +746,22 @@ static void pseudo_server_loop_epoll(void) } pseudo_debug(PDBGF_SERVER, "server loop complete [%d clients left]\n", active_clients); } else { - pseudo_diag("epoll_wait failed: %s\n", strerror(errno)); + pseudo_error("epoll_wait failed: %s\n", strerror(errno)); break; } if (do_list_clients) { do_list_clients = 0; - pseudo_diag("listing clients [1 through %d]:\n", highest_client); + pseudo_info("listing clients [1 through %d]:\n", highest_client); for (i = 1; i <= highest_client; ++i) { if (clients[i].fd == -1) { - pseudo_diag("client %4d: inactive.\n", i); + pseudo_info("client %4d: inactive.\n", i); continue; } - pseudo_diag("client %4d: fd %4d, pid %5d, program %s\n", + pseudo_info("client %4d: fd %4d, pid %5d, program %s\n", i, clients[i].fd, clients[i].pid, clients[i].program ? clients[i].program : ""); } - pseudo_diag("done.\n"); + pseudo_info("done.\n"); } if (die_peacefully || die_forcefully) { pseudo_debug(PDBGF_SERVER, "quitting.\n"); @@ -807,7 +807,7 @@ pseudo_server_loop(void) { clients = malloc(16 * sizeof(*clients)); if (!clients) { - pseudo_diag("out of memory allocating client table.\n"); + pseudo_error("out of memory allocating client table.\n"); exit(PSEUDO_EXIT_LISTEN_FD); } @@ -830,7 +830,7 @@ pseudo_server_loop(void) { pseudo_debug(PDBGF_SERVER, "server loop started.\n"); if (listen_fd < 0) { - pseudo_diag("got into loop with no valid listen fd.\n"); + pseudo_error("got into loop with no valid listen fd.\n"); exit(PSEUDO_EXIT_LISTEN_FD); } pdb_log_msg(SEVERITY_INFO, NULL, NULL, NULL, "server started (pid %d)", getpid()); @@ -924,18 +924,18 @@ pseudo_server_loop(void) { } if (do_list_clients) { do_list_clients = 0; - pseudo_diag("listing clients [1 through %d]:\n", highest_client); + pseudo_info("listing clients [1 through %d]:\n", highest_client); for (i = 1; i <= highest_client; ++i) { if (clients[i].fd == -1) { - pseudo_diag("client %4d: inactive.\n", i); + pseudo_info("client %4d: inactive.\n", i); continue; } - pseudo_diag("client %4d: fd %4d, pid %5d, state %s, program %s\n", + pseudo_info("client %4d: fd %4d, pid %5d, state %s, program %s\n", i, clients[i].fd, clients[i].pid, FD_ISSET(clients[i].fd, &reads) ? "R" : "-", clients[i].program ? clients[i].program : ""); } - pseudo_diag("done.\n"); + pseudo_info("done.\n"); } if (die_peacefully || die_forcefully) { pseudo_debug(PDBGF_SERVER, "quitting.\n"); @@ -981,6 +981,6 @@ pseudo_server_loop(void) { timeout = (struct timeval) { .tv_sec = LOOP_DELAY, .tv_usec = 0 }; sigprocmask(SIG_BLOCK, &maskusr2, NULL); } - pseudo_diag("select failed: %s\n", strerror(errno)); + pseudo_error("select failed: %s\n", strerror(errno)); } #endif /* this is the else of #ifdef PSEUDO_EPOLL */ From patchwork Wed Jun 10 11:46:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Sakhonchik X-Patchwork-Id: 89663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B9EACD8CB2 for ; Wed, 10 Jun 2026 11:47:16 +0000 (UTC) Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18629.1781092028500604725 for ; Wed, 10 Jun 2026 04:47:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=CIZyaF0f; spf=pass (domain: gmail.com, ip: 209.85.208.44, mailfrom: frezidok1@gmail.com) Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-6914a658115so5934844a12.0 for ; Wed, 10 Jun 2026 04:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781092027; x=1781696827; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oI5UnFtmAAfyctZhRXoeMQf982EOf8PORKjKasij5vk=; b=CIZyaF0fKm+L7DFGIEX95W2LxZ4pfmKRwiZRPp4AzX7ErVuI+9No36/D38gC1Fgpol TDgeTTZBRCU9souchbVXLLT7SPJ1j1FsVsxN+vT6AMUh4MpAeuM0XG6Hmjpyd6Mdw3Wb ElOcaEgE5aZ4Y8+zTHneGhcrXbf9BWUKHmcxWK0/wpOGbetgdKKUy9W9Cm9vBMuKcm41 m5SzVVC/7vhm6bOYVU4gc48CjrCxtdNPanmoVNQEOU+pJR571FltG0hbCoP3/VTYlJuK ksuUvjvFqyIUJ3nx96v9f0GinAryuQ82KPcjeaDKQjJ3KOfPozCKjtfTween5NK2agpA obSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781092027; x=1781696827; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=oI5UnFtmAAfyctZhRXoeMQf982EOf8PORKjKasij5vk=; b=dELcpAiuIW48Q/l1O0Hy3Tzbpw6sVh2dj7+QewOJFNnd85XiKgKo2bx2zQAjXb8upB SlD8I48XqnqxryJwv97HPUDqregUiSSNI9ycBCCdLMVrvEVFqy3UT3CTeKxV1L1Hiu7d lvWOtSSlSM3dLTQ6h599E+1nWVV8AeTR6xhhaXg3EgrBHf5/zWNgMxnajDa/ElraCTd2 HYR5mjuqiywePpX4PUFQkIy3jGqXEuidvC1caIDjeq90Id1ib5HVnjnj4f0F6JyYw8Ul 0mfjQ3+XTnbF6QxEGcCU3TweXlw9QFLJC9o4pgcDTla6F5g0chlPQzQ2LQWxght7gYI8 KbwQ== X-Gm-Message-State: AOJu0YwLG3ISUCyNifOESZ+ooVI2pKecvIjijhY0BHThr42AgKzurhrf EFDsMhiBb23DiWIUNCciWT6oqr6ErFJw/xmqQKMN3Cni1BXl2aePba8xE5ukNqu8 X-Gm-Gg: Acq92OHsLpC8Cw3sbC4cQdlsqJQnEK1qsiGCVpeo8OZ2/eQO/JhJwkN+Q+/srRnd/S7 nNRhIwvunqX/ISVRnZ4Q35QXdPvmHEmcZJYckmlMenH2g2MoftaRXfsB97jwDiO5kvixj9Uznx3 LS0Ya7ilDZhykG+ZpuQBa1duhuRp4rzZHIhF2NJkaopv7o23M00jlw+wGjkwOtqODVGJEhWWc5s 6jyFPYx1eIOzDEiSUFlCnFxf9I1gWkEYVurvXp1kw87Pk8afY+DcRQAb4JZGLk7sW1WJYF/RisE 1nIAa2PuDPSsoXHi9+Fl5+Qw1H8geXSRFawXctjErPPtTXt+n3CdrlBYNGl7tnzbMI3Avw+yx9v QcX8QqP9IV2FHvqTIQ61eDug0F0mFcbVh6/s+JrDd0xiNg47+WrbiL+Br1hH6r/kiTNYrNz5yNu DQlUpj/r1mSXomTNSogKz99fJx1bEJ X-Received: by 2002:a05:6402:4506:b0:68a:88cd:eb22 with SMTP id 4fb4d7f45d1cf-68fa535d734mr11624557a12.26.1781092026483; Wed, 10 Jun 2026 04:47:06 -0700 (PDT) Received: from ubuntu1.. ([194.87.83.187]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6912faea64dsm5997164a12.19.2026.06.10.04.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2026 04:47:05 -0700 (PDT) From: frezidok1@gmail.com To: yocto-patches@lists.yoctoproject.org Cc: Dmitry Sakhonchik Subject: [pseudo] [PATCH 5/8] pseudo.c: Change pseudo_diag() calls to appropriate macros Date: Wed, 10 Jun 2026 14:46:07 +0300 Message-ID: <20260610114610.60776-5-frezidok1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260610114610.60776-1-frezidok1@gmail.com> References: <20260610114610.60776-1-frezidok1@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 10 Jun 2026 11:47:16 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/4196 From: Dmitry Sakhonchik Implements [YOCTO #12141] Signed-off-by: Dmitry Sakhonchik --- pseudo.c | 100 +++++++++++++++++++++++++++---------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/pseudo.c b/pseudo.c index e5fe5cf..11112dd 100644 --- a/pseudo.c +++ b/pseudo.c @@ -105,8 +105,8 @@ main(int argc, char *argv[]) { pseudo_debug(PDBGF_SERVER, "[server %d] can't run daemon with libpseudo in %s\n", getpid(), PRELINK_LIBRARIES); s = pseudo_get_value("PSEUDO_UNLOAD"); if (s) { - pseudo_diag("pseudo: I can't seem to make %s go away. Sorry.\n", PRELINK_LIBRARIES); - pseudo_diag("pseudo: %s: %s\n", PRELINK_LIBRARIES, ld_env); + pseudo_error("pseudo: I can't seem to make %s go away. Sorry.\n", PRELINK_LIBRARIES); + pseudo_error("pseudo: %s: %s\n", PRELINK_LIBRARIES, ld_env); exit(PSEUDO_EXIT_PSEUDO_LOADED); } free(s); @@ -155,7 +155,7 @@ main(int argc, char *argv[]) { case 'i': /* renumber devices, assuming stable inodes */ s = PSEUDO_ROOT_PATH(AT_FDCWD, optarg, 0); if (!s) { - pseudo_diag("Can't resolve path '%s'\n", optarg); + pseudo_error("Can't resolve path '%s'\n", optarg); usage(EXIT_FAILURE); } opt_i = strdup(s); @@ -168,7 +168,7 @@ main(int argc, char *argv[]) { case 'm': /* move from... (see also 'M') */ s = PSEUDO_ROOT_PATH(AT_FDCWD, optarg, 0); if (!s) { - pseudo_diag("Can't resolve move-from path '%s'\n", optarg); + pseudo_error("Can't resolve move-from path '%s'\n", optarg); usage(EXIT_FAILURE); } opt_m = strdup(s); @@ -176,7 +176,7 @@ main(int argc, char *argv[]) { case 'M': /* move to... (see also 'm') */ s = PSEUDO_ROOT_PATH(AT_FDCWD, optarg, 0); if (!s) { - pseudo_diag("Can't resolve move-to path '%s'\n", optarg); + pseudo_error("Can't resolve move-to path '%s'\n", optarg); usage(EXIT_FAILURE); } opt_M = strdup(s); @@ -184,7 +184,7 @@ main(int argc, char *argv[]) { case 'p': /* passwd file path */ s = PSEUDO_ROOT_PATH(AT_FDCWD, optarg, AT_SYMLINK_NOFOLLOW); if (!s) { - pseudo_diag("Can't resolve passwd path '%s'\n", optarg); + pseudo_error("Can't resolve passwd path '%s'\n", optarg); usage(EXIT_FAILURE); } pseudo_set_value("PSEUDO_PASSWD", s); @@ -192,7 +192,7 @@ main(int argc, char *argv[]) { case 'P': /* prefix */ s = PSEUDO_ROOT_PATH(AT_FDCWD, optarg, AT_SYMLINK_NOFOLLOW); if (!s) { - pseudo_diag("Can't resolve prefix path '%s'\n", optarg); + pseudo_error("Can't resolve prefix path '%s'\n", optarg); usage(EXIT_FAILURE); } pseudo_set_value("PSEUDO_PREFIX", s); @@ -201,7 +201,7 @@ main(int argc, char *argv[]) { case 'R': /* pseudo root path */ s = PSEUDO_ROOT_PATH(AT_FDCWD, optarg, AT_SYMLINK_NOFOLLOW); if (!s) { - pseudo_diag("Can't resolve root path '%s'\n", optarg); + pseudo_error("Can't resolve root path '%s'\n", optarg); usage(EXIT_FAILURE); } pseudo_set_value("PSEUDO_CHROOT", s); @@ -214,7 +214,7 @@ main(int argc, char *argv[]) { case 't': /* timeout */ pseudo_server_timeout = pseudo_strtol_wrapper(optarg, &s, 10); if (*s && !isspace(*s)) { - pseudo_diag("Timeout must be an integer value.\n"); + pseudo_error("Timeout must be an integer value.\n"); usage(EXIT_FAILURE); } optptr += snprintf(optptr, pseudo_path_max() - (optptr - opts), @@ -239,7 +239,7 @@ main(int argc, char *argv[]) { break; case '?': default: - pseudo_diag("unknown/invalid argument (option '%c').\n", optopt); + pseudo_error("unknown/invalid argument (option '%c').\n", optopt); usage(EXIT_FAILURE); break; } @@ -250,7 +250,7 @@ main(int argc, char *argv[]) { s = pseudo_get_prefix(argv[0]); if (!s) { - pseudo_diag("Can't figure out prefix. Set PSEUDO_PREFIX or invoke with full path.\n"); + pseudo_error("Can't figure out prefix. Set PSEUDO_PREFIX or invoke with full path.\n"); exit(PSEUDO_EXIT_PSEUDO_PREFIX); } free(s); @@ -261,29 +261,29 @@ main(int argc, char *argv[]) { pseudo_msg_t *msg; int rc; if (!(opt_m && opt_M)) { - pseudo_diag("You cannot move the database without specifying from and to.\n"); + pseudo_error("You cannot move the database without specifying from and to.\n"); exit(EXIT_FAILURE); } if (stat(opt_M, &buf) < 0) { - pseudo_diag("stat of '%s' failed: %s\n", + pseudo_error("stat of '%s' failed: %s\n", opt_M, strerror(errno)); - pseudo_diag("The directory the database is being moved to must exist.\n"); + pseudo_error("The directory the database is being moved to must exist.\n"); exit(EXIT_FAILURE); } msg = pseudo_msg_new(0, opt_M); if (!msg) { - pseudo_diag("Can't allocate message structure.\n"); + pseudo_error("Can't allocate message structure.\n"); exit(EXIT_FAILURE); } rc = pdb_rename_file(opt_m, msg); free(msg); if (rc < 0) { - pseudo_diag("Warning: Database move may have failed.\n"); - pseudo_diag("To try to restore, you can reverse the move.\n"); - pseudo_diag("To commit to this anyway, run pseudo -C to check the database.\n"); + pseudo_warning("Database move may have failed.\n"); + pseudo_warning("To try to restore, you can reverse the move.\n"); + pseudo_warning("To commit to this anyway, run pseudo -C to check the database.\n"); exit(EXIT_FAILURE); } - pseudo_diag("Rename looked okay, running database sanity check.\n"); + pseudo_info("Rename looked okay, running database sanity check.\n"); opt_C = 1; } @@ -292,32 +292,32 @@ main(int argc, char *argv[]) { struct stat buf; pseudo_msg_t *msg; if (stat(opt_i, &buf) < 0) { - pseudo_diag("stat of '%s' failed: %s\n", + pseudo_error("stat of '%s' failed: %s\n", opt_i, strerror(errno)); - pseudo_diag("The file used to renumber the database must exist.\n"); + pseudo_error("The file used to renumber the database must exist.\n"); exit(EXIT_FAILURE); } msg = pseudo_msg_new(0, opt_i); if (!msg) { - pseudo_diag("Couldn't allocate data structure for path.\n"); + pseudo_error("Couldn't allocate data structure for path.\n"); exit(EXIT_FAILURE); } if (pdb_find_file_path(msg)) { - pseudo_diag("Couldn't find a database entry for '%s'.\n", opt_i); + pseudo_error("Couldn't find a database entry for '%s'.\n", opt_i); exit(EXIT_FAILURE); } if (buf.st_ino != msg->ino) { - pseudo_diag("The database inode entry for '%s' doesn't match; you must use -b.\n", + pseudo_error("The database inode entry for '%s' doesn't match; you must use -b.\n", opt_i); exit(EXIT_FAILURE); } rc = pdb_renumber_all(msg->dev, buf.st_dev); free(msg); if (rc < 0) { - pseudo_diag("Warning: Database renumber failed.\n"); + pseudo_warning("Database renumber failed.\n"); exit(EXIT_FAILURE); } - pseudo_diag("Renumber looked okay, running database sanity check.\n"); + pseudo_info("Renumber looked okay, running database sanity check.\n"); opt_C = 1; } @@ -332,13 +332,13 @@ main(int argc, char *argv[]) { } if (opt_d && opt_f) { - pseudo_diag("You cannot run a foregrounded daemon.\n"); + pseudo_error("You cannot run a foregrounded daemon.\n"); exit(PSEUDO_EXIT_PSEUDO_INVOCATION); } if (opt_f || opt_d) { if (argc > optind) { - pseudo_diag("pseudo: running program implies spawning background daemon.\n"); + pseudo_error("pseudo: running program implies spawning background daemon.\n"); exit(PSEUDO_EXIT_PSEUDO_INVOCATION); } } else { @@ -347,7 +347,7 @@ main(int argc, char *argv[]) { if (opt_r) { if (chdir(opt_r) == -1) { - pseudo_diag("failed to chdir to '%s': %s\n", + pseudo_error("failed to chdir to '%s': %s\n", opt_r, strerror(errno)); exit(EXIT_FAILURE); } @@ -378,7 +378,7 @@ main(int argc, char *argv[]) { int len = strcspn(path, ":"); if ( snprintf(fullpath, pseudo_path_max(), "%.*s/%s", len, path, argv[0]) > (int) pseudo_path_max()) { - pseudo_diag("pseudo: path too long.\n"); + pseudo_error("pseudo: path too long.\n"); exit(EXIT_FAILURE); } path += len; @@ -392,7 +392,7 @@ main(int argc, char *argv[]) { } } if (!found) { - pseudo_diag("Can't find '%s' in $PATH.\n", + pseudo_error("Can't find '%s' in $PATH.\n", argv[0]); exit(EXIT_FAILURE); } @@ -401,7 +401,7 @@ main(int argc, char *argv[]) { rc = fork(); if (rc == -1) { - pseudo_diag("pseudo: fork failed: %s\n", + pseudo_error("pseudo: fork failed: %s\n", strerror(errno)); exit(EXIT_FAILURE); } else { @@ -424,7 +424,7 @@ main(int argc, char *argv[]) { } else { rc = execv(fullpath, argv); if (rc == -1) { - pseudo_diag("pseudo: can't run %s: %s\n", + pseudo_error("pseudo: can't run %s: %s\n", argv[0], strerror(errno)); } } @@ -615,7 +615,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon */ pdb_did_unlink_file(msg->path, NULL, by_path.deleting); } else { - pseudo_diag("inode mismatch: '%s' ino %llu in db, %llu in request.\n", + pseudo_error("inode mismatch: '%s' ino %llu in db, %llu in request.\n", msg->path, (unsigned long long) by_path.ino, (unsigned long long) msg_header.ino); @@ -634,14 +634,14 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon * the bogus entry that we noticed. */ if (S_ISDIR(by_path.mode) != S_ISDIR(msg_header.mode)) { - pseudo_diag("dir mismatch: '%s' [%llu] db mode 0%o, header mode 0%o (unlinking db)\n", + pseudo_error("dir mismatch: '%s' [%llu] db mode 0%o, header mode 0%o (unlinking db)\n", msg->path, (unsigned long long) by_path.ino, (int) by_path.mode, (int) msg_header.mode); /* unlink this path -- the inode may be in use elsewhere */ pdb_unlink_file(msg); found_path = 0; } else if (S_ISLNK(by_path.mode) != S_ISLNK(msg_header.mode)) { - pseudo_diag("symlink mismatch: '%s' [%llu] db mode 0%o, header mode 0%o (unlinking db)\n", + pseudo_error("symlink mismatch: '%s' [%llu] db mode 0%o, header mode 0%o (unlinking db)\n", msg->path, (unsigned long long) by_path.ino, (int) by_path.mode, (int) msg_header.mode); /* unlink this path -- the inode may be in use elsewhere */ @@ -649,7 +649,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon found_path = 0; } if (trailing_slash && !S_ISDIR(by_path.mode)) { - pseudo_diag("dir quasi-mismatch: '%s' [%llu] db mode 0%o, incoming path had trailing slash. Not unlinking.\n", + pseudo_error("dir quasi-mismatch: '%s' [%llu] db mode 0%o, incoming path had trailing slash. Not unlinking.\n", msg->path, (unsigned long long) by_path.ino, (int) by_path.mode); } @@ -713,7 +713,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon pseudo_debug(PDBGF_FILE, "inode mismatch for '%s' -- old one was marked for deletion.\n", msg->path); } else { - pseudo_diag("path mismatch [%d link%s]: ino %llu db '%s' req '%s'.\n", + pseudo_error("path mismatch [%d link%s]: ino %llu db '%s' req '%s'.\n", msg->nlink, msg->nlink == 1 ? "" : "s", (unsigned long long) msg_header.ino, @@ -734,7 +734,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon * entry. There is no way it can be right. */ if (S_ISDIR(by_ino.mode) != S_ISDIR(msg_header.mode)) { - pseudo_diag("dir err : %llu ['%s'] (db '%s') db mode 0%o, header mode 0%o (unlinking db)\n", + pseudo_error("dir err : %llu ['%s'] (db '%s') db mode 0%o, header mode 0%o (unlinking db)\n", (unsigned long long) msg_header.ino, msg->pathlen ? msg->path : "no path", path_by_ino ? path_by_ino : "no path", @@ -746,7 +746,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon * can ever be a symlink; the test is generic as * insurance against forgetting to fix it in a future * update. */ - pseudo_diag("symlink err : %llu ['%s'] (db '%s') db mode 0%o, header mode 0%o (unlinking db)\n", + pseudo_error("symlink err : %llu ['%s'] (db '%s') db mode 0%o, header mode 0%o (unlinking db)\n", (unsigned long long) msg_header.ino, msg->pathlen ? msg->path : "no path", path_by_ino ? path_by_ino : "no path", @@ -771,7 +771,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon case OP_CLOSE: /* these messages are handled entirely on the client side, * as of this writing, but might be logged by accident: */ - pseudo_diag("error: op %s sent to server.\n", pseudo_op_name(msg->op)); + pseudo_error("op %s sent to server.\n", pseudo_op_name(msg->op)); break; case OP_EXEC: /* FALLTHROUGH */ case OP_OPEN: @@ -785,7 +785,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon * ... But only if it wasn't a match on both inode *and* * path, because if it were, that would be harmless. */ - pseudo_diag("creat for '%s' replaces existing %llu ['%s'].\n", + pseudo_info("creat for '%s' replaces existing %llu ['%s'].\n", msg->pathlen ? msg->path : "no path", (unsigned long long) by_ino.ino, path_by_ino ? path_by_ino : "no path"); @@ -797,7 +797,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon pdb_link_file(msg); } else { /* again, an error, but leaving it alone for now. */ - pseudo_diag("creat ignored for existing file '%s'.\n", + pseudo_error("creat ignored for existing file '%s'.\n", msg->pathlen ? msg->path : "no path"); } break; @@ -984,7 +984,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon * file DID NOT exist before the call. Fix database: */ if (found_path) { - pseudo_diag("mkdir/mknod: '%s' [%llu] already existed (mode 0%o), unlinking\n", + pseudo_info("mkdir/mknod: '%s' [%llu] already existed (mode 0%o), unlinking\n", msg->path, (unsigned long long) by_path.ino, (int) by_path.mode); pdb_unlink_file(msg); @@ -1035,7 +1035,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon pdb_remove_xattr(msg, oldpath, oldpathlen); break; default: - pseudo_diag("unknown op from client %d, op %d [%s]\n", + pseudo_error("unknown op from client %d, op %d [%s]\n", msg->client, msg->op, msg->pathlen ? msg->path : "no path"); break; @@ -1110,7 +1110,7 @@ pseudo_db_check(int fix) { l = pdb_files(); if (!l) { - pseudo_diag("Couldn't start file list, can't scan.\n"); + pseudo_error("Couldn't start file list, can't scan.\n"); return EXIT_FAILURE; } while ((m = pdb_file(l)) != NULL) { @@ -1123,7 +1123,7 @@ pseudo_db_check(int fix) { pseudo_debug(PDBGF_DB, "Checking <%s>\n", m->path); if (lstat(m->path, &buf)) { if (!fix) { - pseudo_diag("can't stat <%s>\n", m->path); + pseudo_error("can't stat <%s>\n", m->path); errors = EXIT_FAILURE; continue; } else { @@ -1180,7 +1180,7 @@ pseudo_db_check(int fix) { rc = pdb_may_unlink_file(m, magic_cookie); } if (rc) { - pseudo_diag("error updating file %s\n", + pseudo_error("error updating file %s\n", m->path); errors = EXIT_FAILURE; } @@ -1195,8 +1195,8 @@ pseudo_db_check(int fix) { if (delete_some) { rc = pdb_did_unlink_files(magic_cookie); if (rc) { - pseudo_diag("error nuking mismatched files.\n"); - pseudo_diag("database may not be fixed.\n"); + pseudo_error("error nuking mismatched files.\n"); + pseudo_error("database may not be fixed.\n"); errors = EXIT_FAILURE; } } From patchwork Wed Jun 10 11:46:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Sakhonchik X-Patchwork-Id: 89664 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21D71CD8CB9 for ; Wed, 10 Jun 2026 11:47:26 +0000 (UTC) Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18632.1781092038389549229 for ; Wed, 10 Jun 2026 04:47:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=qSXDxsU1; spf=pass (domain: gmail.com, ip: 209.85.208.51, mailfrom: frezidok1@gmail.com) Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-687ed9aabb3so13119638a12.1 for ; Wed, 10 Jun 2026 04:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781092037; x=1781696837; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8FfiefZ2Iv6Y+bSBqRU8RJhOCQtMXaaY/t2xo867vE8=; b=qSXDxsU13uj58rHMc5HotszitSDUkGVon7bAlHeR9Z/oSLurUO6TcFf6dUEy7qvdZ4 pyo/m15S7AEFMeImMhtg3r8CCiLqlJtFTHp3pbUtyi1VzkLOHzhPWZuodpIqSLfB3s0x GJm9JwVB92syE0gsih9IPSse2mRRkcPT93aB7OYhO4PycqcZG3ZqXOvpz9CX+OfMyOyN tv7YTSAhAOPWf8WZcx0qLddIsvzmM3Kv/mnpfW50JjcQV/z+VJkba856nHvS2Q9q1/9J pLMmLE/xkUXl6nvtQdX8IaIQre4irLR+FQupDx9mM05N+JPJBuCnD/wSr2iwy+9oSFv5 Wlsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781092037; x=1781696837; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8FfiefZ2Iv6Y+bSBqRU8RJhOCQtMXaaY/t2xo867vE8=; b=c+/cK9VunPYlt++vMXRkNC/bMDrz6BOzmPrbn8+WSbq2T4lY9tT0UAYupNoRIYXpwl iTprv2+e/zyLwhx7g8MMwKXGHH2EetBcVniH7U0htBE2xLaz9w5HCCQbMmeKGL+eRcYx 5uF5OdvSplXjaFhbZ2rh5CMNobqAYQID81HcuWyqvzNIczamXorzKCzeUbCu2NWkm2/W y/QydZa5bzrR87E6qirnguCM89LBE83We27dT0xSsBPXBqvHEJHL58wPzT8CGp4w8NYU ZdNnwPwR1IS3iJFhF5sz1l9GzeDXpihICq887HrGuJJlw4jbNojBf5CAGaNYBR1+b1XW o9oQ== X-Gm-Message-State: AOJu0Yxw0w+eYTSLont2NtHcjnh1Jt2HMmQnIXci27n8iP2saUS86xGk r/bUZQyCYDEYatub3Z/lTfW7qHV5k7xtD+IrM1ef3sZnPxbnhjAQ1IIsgPqgDzDb X-Gm-Gg: Acq92OFaca9T66VlTzWnYQ3WPfZITFT2zMMja1lBSAYqQ6vyGa3rt7S8of9giZrPAA0 glytY8im0MAqOmRvPiXyVaKuxB+lbmgDDraObAMCmDGd7CbfRlXS7Y32A5/F8e3iP9OYBLkN3f4 So0v/gDhOYo2jFkvBrRg3rQYPxPRmEAtevuAMwgw0qBHzLZrJoBN7SINpVlUVlgL/kRw6HQ9j5I GmCWTDOWFIUyqhdgWUBlEQlVG6omgFGJxXNxGg2uXL06x4JRCFReED0wPw37CwI4wcfRuTFMpE6 wSYYgTVCrMUktt8pLJeIklUgQw/Oekuxpi6iTMs1N1LA9m3DzGKcay+MChn3YO2kNm/owEssuh9 lNFMGnrzATHu0IH+KGbEF+hvs/O/ULZCQ4p28IW3Adwrw/Ci20eIkhGeBkJYEUu2gB3PRLPomZx k6Jgj1fOkj0na/UshB3jCL/l+4U+8c X-Received: by 2002:a05:6402:51c9:b0:68c:eb73:3918 with SMTP id 4fb4d7f45d1cf-68fa4d225c6mr12639915a12.10.1781092036440; Wed, 10 Jun 2026 04:47:16 -0700 (PDT) Received: from ubuntu1.. ([194.87.83.187]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6912faea64dsm5997164a12.19.2026.06.10.04.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2026 04:47:15 -0700 (PDT) From: frezidok1@gmail.com To: yocto-patches@lists.yoctoproject.org Cc: Dmitry Sakhonchik Subject: [pseudo] [PATCH 6/8] pseudolog.c: Change pseudo_diag() calls to appropriate macros Date: Wed, 10 Jun 2026 14:46:08 +0300 Message-ID: <20260610114610.60776-6-frezidok1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260610114610.60776-1-frezidok1@gmail.com> References: <20260610114610.60776-1-frezidok1@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 10 Jun 2026 11:47:26 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/4197 From: Dmitry Sakhonchik Implements [YOCTO #12141] Signed-off-by: Dmitry Sakhonchik --- pseudolog.c | 76 ++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/pseudolog.c b/pseudolog.c index 44f7dbf..a497eb5 100644 --- a/pseudolog.c +++ b/pseudolog.c @@ -128,7 +128,7 @@ plog_query_type(char **string) { return PSQT_UNKNOWN; switch (**string) { case '\0': - pseudo_diag("Error: Value may not be an empty string."); + pseudo_error("Value may not be an empty string."); return PSQT_UNKNOWN; break; case '>': @@ -170,7 +170,7 @@ plog_query_type(char **string) { break; } if (opt_l && type != PSQT_EXACT) { - pseudo_diag("Error: Non-exact match requested while trying to create a log entry.\n"); + pseudo_error("Non-exact match requested while trying to create a log entry.\n"); type = PSQT_UNKNOWN; } return type; @@ -214,7 +214,7 @@ parse_file_type(char *string) { return S_IFSOCK; break; default: - pseudo_diag("unknown file type %c; should be one of [-bcdflps]\n", + pseudo_error("unknown file type %c; should be one of [-bcdflps]\n", isprint(*string) ? *string : '?'); return -1; break; @@ -231,7 +231,7 @@ parse_partial_mode(char *string) { case '-': break; default: - pseudo_diag("unknown mode character: %c\n", string[0]); + pseudo_error("unknown mode character: %c\n", string[0]); return -1; break; } @@ -242,7 +242,7 @@ parse_partial_mode(char *string) { case '-': break; default: - pseudo_diag("unknown mode character: %c\n", string[1]); + pseudo_error("unknown mode character: %c\n", string[1]); return -1; break; } @@ -261,7 +261,7 @@ parse_partial_mode(char *string) { case '-': break; default: - pseudo_diag("unknown mode character: %c\n", string[2]); + pseudo_error("unknown mode character: %c\n", string[2]); return -1; break; } @@ -275,14 +275,14 @@ parse_mode_string(char *string) { mode_t bits = 0; if (len != 9 && len != 10) { - pseudo_diag("mode strings must be of the form [-]rwxr-xr-x\n"); + pseudo_error("mode strings must be of the form [-]rwxr-xr-x\n"); return -1; } if (len == 10) { mode |= parse_file_type(string); ++string; if (mode == (mode_t) -1) { - pseudo_diag("mode strings with a file type must use a valid type [-bcdflps]\n"); + pseudo_error("mode strings with a file type must use a valid type [-bcdflps]\n"); return -1; } } @@ -341,14 +341,14 @@ parse_timestamp(char *string) { } } if (!time_formats[i]) { - pseudo_diag("Couldn't parse <%s> as a time. Current time in known formats is:\n", + pseudo_error("Couldn't parse <%s> as a time. Current time in known formats is:\n", string); localtime_r(&stamp_sec, &stamp_tm); for (i = 0; time_formats[i]; ++i) { strftime(timebuf, sizeof(timebuf), time_formats[i], &stamp_tm); - pseudo_diag("\t%s\n", timebuf); + pseudo_info("\t%s\n", timebuf); } - pseudo_diag("Or, specify your own with -E; see strptime(3).\n"); + pseudo_info("Or, specify your own with -E; see strptime(3).\n"); return -1; } return mktime(&stamp_tm); @@ -360,31 +360,31 @@ plog_trait(int opt, char *string) { char *endptr; if (opt < 0 || opt > UCHAR_MAX) { - pseudo_diag("Unknown/invalid option value: %d\n", opt); + pseudo_error("Unknown/invalid option value: %d\n", opt); return 0; } if (!opt_to_field[opt]) { if (isprint(opt)) { - pseudo_diag("Unknown option: -%c\n", opt); + pseudo_error("Unknown option: -%c\n", opt); } else { - pseudo_diag("Unknown option: 0x%02x\n", opt); + pseudo_error("Unknown option: 0x%02x\n", opt); } return 0; } if (!*string) { - pseudo_diag("invalid empty string for -%c\n", opt); + pseudo_error("invalid empty string for -%c\n", opt); return 0; } new_trait = calloc(1, sizeof(*new_trait)); if (!new_trait) { - pseudo_diag("Couldn't allocate requested trait (for -%c %s)\n", + pseudo_error("Couldn't allocate requested trait (for -%c %s)\n", opt, string ? string : ""); return 0; } new_trait->field = opt_to_field[opt]; new_trait->type = plog_query_type(&string); if (new_trait->type == PSQT_UNKNOWN) { - pseudo_diag("Couldn't comprehend trait type for '%s'\n", + pseudo_error("Couldn't comprehend trait type for '%s'\n", string ? string : ""); free(new_trait); return 0; @@ -393,7 +393,7 @@ plog_trait(int opt, char *string) { case PSQF_ACCESS: new_trait->data.ivalue = pseudo_access_fopen(string); if (new_trait->data.ivalue == (unsigned long long) -1) { - pseudo_diag("access flags should be specified like fopen(3) mode strings (or x for exec).\n"); + pseudo_error("access flags should be specified like fopen(3) mode strings (or x for exec).\n"); free(new_trait); return 0; } @@ -406,7 +406,7 @@ plog_trait(int opt, char *string) { * first character is the terminating NUL, we may not * access the second. */ if (string[0] && string[1]) { - pseudo_diag("file type must be a single character [-bcdflps].\n"); + pseudo_error("file type must be a single character [-bcdflps].\n"); free(new_trait); return 0; } @@ -421,13 +421,13 @@ plog_trait(int opt, char *string) { break; case PSQF_ORDER: if (string[0] && string[1]) { - pseudo_diag("order type must be a single specifier character.\n"); + pseudo_error("order type must be a single specifier character.\n"); free(new_trait); return 0; } new_trait->data.ivalue = opt_to_field[(unsigned char) string[0]]; if (!new_trait->data.ivalue) { - pseudo_diag("Unknown field type: %c\n", string[0]); + pseudo_error("Unknown field type: %c\n", string[0]); } break; case PSQF_RESULT: @@ -454,7 +454,7 @@ plog_trait(int opt, char *string) { case PSQF_UID: new_trait->data.ivalue = pseudo_strtoll_wrapper(string, &endptr, 0); if (*endptr) { - pseudo_diag("Unexpected garbage after number (%llu): '%s'\n", + pseudo_error("Unexpected garbage after number (%llu): '%s'\n", new_trait->data.ivalue, endptr); free(new_trait); return 0; @@ -485,7 +485,7 @@ plog_trait(int opt, char *string) { new_trait->data.svalue = strdup(string); break; default: - pseudo_diag("I don't know how I got here. Unknown field type %d.\n", + pseudo_error("I don't know how I got here. Unknown field type %d.\n", new_trait->field); free(new_trait); return 0; @@ -518,7 +518,7 @@ main(int argc, char **argv) { case 'P': s = PSEUDO_ROOT_PATH(AT_FDCWD, optarg, AT_SYMLINK_NOFOLLOW); if (!s) - pseudo_diag("Can't resolve prefix path '%s'\n", optarg); + pseudo_error("Can't resolve prefix path '%s'\n", optarg); pseudo_set_value("PSEUDO_PREFIX", s); break; case 'v': @@ -597,12 +597,12 @@ main(int argc, char **argv) { pseudo_debug_flags_finalize(); if (optind < argc) { - pseudo_diag("Error: Extra arguments not associated with any option.\n"); + pseudo_error("extra arguments not associated with any option.\n"); usage(EXIT_FAILURE); } if (query_only && opt_l) { - pseudo_diag("Error: -l cannot be used with query-only options or flags.\n"); + pseudo_error("-l cannot be used with query-only options or flags.\n"); bad_args = 1; } @@ -611,22 +611,22 @@ main(int argc, char **argv) { exit(EXIT_FAILURE); if (!pseudo_get_prefix(argv[0])) { - pseudo_diag("Can't figure out prefix. Set PSEUDO_PREFIX or invoke with full path.\n"); + pseudo_error("Can't figure out prefix. Set PSEUDO_PREFIX or invoke with full path.\n"); exit(EXIT_FAILURE); } if (!pseudo_get_bindir()) { - pseudo_diag("Can't figure out bindir. Set PSEUDO_BINDIR.\n"); + pseudo_error("Can't figure out bindir. Set PSEUDO_BINDIR.\n"); exit(EXIT_FAILURE); } if (!pseudo_get_libdir()) { - pseudo_diag("Can't figure out libdir. Set PSEUDO_LIBDIR.\n"); + pseudo_error("Can't figure out libdir. Set PSEUDO_LIBDIR.\n"); exit(EXIT_FAILURE); } if (!pseudo_get_localstatedir()) { - pseudo_diag("Can't figure out localstatedir. Set PSEUDO_LOCALSTATEDIR.\n"); + pseudo_error("Can't figure out localstatedir. Set PSEUDO_LOCALSTATEDIR.\n"); exit(EXIT_FAILURE); } @@ -636,12 +636,12 @@ main(int argc, char **argv) { int fields; fields = format_scan(format); if (fields == -1) { - pseudo_diag("couldn't parse format string (%s).\n", format); + pseudo_error("couldn't parse format string (%s).\n", format); return EXIT_FAILURE; } if (opt_D) { if (pdb_delete(traits, fields)) { - pseudo_diag("errors occurred trying to delete entries.\n"); + pseudo_error("errors occurred trying to delete entries.\n"); } } else { history = pdb_history(traits, fields, opt_U); @@ -653,7 +653,7 @@ main(int argc, char **argv) { } pdb_history_free(history); } else { - pseudo_diag("could not retrieve history.\n"); + pseudo_error("could not retrieve history.\n"); return EXIT_FAILURE; } } @@ -674,12 +674,12 @@ format_one(log_entry *e, char *format) { char *s; if (!e || !format) { - pseudo_diag("invalid log entry or format specifier.\n"); + pseudo_error("invalid log entry or format specifier.\n"); return 0; } real_len = snprintf(fmtbuf, sizeof(fmtbuf), "%.*s", (int) len + 1, format); if (real_len >= sizeof(fmtbuf) - 1) { - pseudo_diag("Format string way too long starting at %.10s", + pseudo_error("Format string way too long starting at %.10s", format - 1); return 0; } @@ -690,7 +690,7 @@ format_one(log_entry *e, char *format) { * parameters -- this doesn't make sense here. */ if (strchr(fmtbuf, '*') || strchr(fmtbuf, 'l') || strchr(fmtbuf, 'h')) { - pseudo_diag("Sorry, you can't use *, h, or l format modifiers.\n"); + pseudo_error("Sorry, you can't use *, h, or l format modifiers.\n"); return 0; } @@ -830,7 +830,7 @@ format_scan(char *format) { len = strcspn(s, "acdfgGimMoprRsStTuy"); s += len; if (!*s) { - pseudo_diag("Unknown format: '%.3s'\n", + pseudo_error("Unknown format: '%.3s'\n", (s - len)); return -1; } @@ -865,7 +865,7 @@ format_scan(char *format) { */ break; default: - pseudo_diag("error: invalid format specifier %c (at %s)\n", *s, s); + pseudo_error("invalid format specifier %c (at %s)\n", *s, s); return -1; break; } From patchwork Wed Jun 10 11:46:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Sakhonchik X-Patchwork-Id: 89665 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 159DACD8CB2 for ; Wed, 10 Jun 2026 11:47:26 +0000 (UTC) Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18634.1781092042237948227 for ; Wed, 10 Jun 2026 04:47:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=GptkZbdj; spf=pass (domain: gmail.com, ip: 209.85.208.45, mailfrom: frezidok1@gmail.com) Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-6914a658115so5935174a12.0 for ; Wed, 10 Jun 2026 04:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781092040; x=1781696840; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sKjJo4h6Iz1eCSezgQvZevQhOFuwgYtcblIWuWOlzfg=; b=GptkZbdjY5tLbWQKP7lDTswdwMcOH+aGIaZjAy5UHi1dyb8Bh+EtVlFm0r4A4mdScF NjalFRQ3vm/SVZMe69C/OwyysIedFzsjgTy5LpfDv7cnG1r9PT01WLDlmJrU9Ehuioq0 rKm1tGA71EhWXhItP74fpKQBDnRMUMF+U/aRshJxGucHJDPw3+rwGOgzXiILeYOqqVHb TYnD342NQkoHEByTmbzHMnJifXUHnuQjyUh+l1SnDg0A1jU/SZWi3lB+Z/UShTlV+eLr LFsy0HKtSCaOvc14Oa3R2iziOd5LzWDVeNBU+Y5Map7Gnprc6oDYDtaGEvFlJ84H904I hbLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781092040; x=1781696840; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=sKjJo4h6Iz1eCSezgQvZevQhOFuwgYtcblIWuWOlzfg=; b=ZGwr4sb1O6EydaOZhX2D1ci/cuOTobp6bMOt4d33z3ZV6cgKI0aF/uO2VjtJUfGMr3 xp4S5R0k1dqSYR4sRzUKUPgtGaga96OBpGi3/4UGaRulRo/+MeDh+8TCKw4rIrhPrrmz zHF829vY3cvJe3pp3LMmkfTStFgcC7O9Rbjjcas96ILUbycfB8bJBxZbby+kSbpfi9IT 7j2SsD8dI5+ugd5LvH9wTkjtWtKH8jm31EBVa5MCujiCjgpqJsKRs6uUXAkRpR5kaQPf aHwRUKtXd7tD8cjZcNjQW42SOdbYyKuhhIet4FJxAZWST+jCsOfsKsu5bq3p35pMDzNs +0/w== X-Gm-Message-State: AOJu0YybsoMVL+9OT3Ht7oaqbkuWwnUewE4lZLEuiM1Zo0BrfqP1xFKR p0bRUBNZwW7S83b0s/xy0/SwcGlTAzTB46FLqGtZe5fBHSyMQ5HzKLr0am/qrTt/ X-Gm-Gg: Acq92OG9Kiwxx3ikT5RTyQUo1NPFLGGOWpn/dA+qy2JFb476x61LzWhAB+DJHx+dUGO yLEPGNFR27sKUaa6jXSw5XZfNEEMKj1YEIaCtU16oBKXqRWjFisACSLuIl+hVdJIZswzL6FB3M7 KhDj5sOolN4Swl9sQJOpoRPq+0OnCxgcPJVTlwbuN7WWRo3um2jB6oAzidfKZket60RJpxMv+dN Kz3uUFY/bam4TeYcjJicZ/0wguiCSTkHID/77jeNqb9jN3K9gFkWN8l0rerSSMTPfiZDFgP0O4Z dJjzqvSd0dspVIy7ZitpNSaGIBwjN6IQDAnehDOXOmVvr5plQvxFXvLS6gyRVSvQobltZPnU1w7 nRt/zGulmuDaDbDjfBAQUJFf9Exy27cgHc+5BVzcCruN8kEB1TI3UC2xAw28LDERF8ZaUDEXHVc C7GyJlM/UeUqcmu0u6jPwXVDScuk+t X-Received: by 2002:a05:6402:43c6:b0:67f:7e9b:afe8 with SMTP id 4fb4d7f45d1cf-68fa4c267femr10916580a12.6.1781092040478; Wed, 10 Jun 2026 04:47:20 -0700 (PDT) Received: from ubuntu1.. ([194.87.83.187]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6912faea64dsm5997164a12.19.2026.06.10.04.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2026 04:47:20 -0700 (PDT) From: frezidok1@gmail.com To: yocto-patches@lists.yoctoproject.org Cc: Dmitry Sakhonchik Subject: [pseudo] [PATCH 7/8] wrappers: Change pseudo_diag() calls to appropriate macros Date: Wed, 10 Jun 2026 14:46:09 +0300 Message-ID: <20260610114610.60776-7-frezidok1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260610114610.60776-1-frezidok1@gmail.com> References: <20260610114610.60776-1-frezidok1@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 10 Jun 2026 11:47:26 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/4198 From: Dmitry Sakhonchik Implements [YOCTO #12141] Signed-off-by: Dmitry Sakhonchik --- ports/darwin/pseudo_wrappers.c | 3 +-- ports/linux/guts/fcntl.c | 2 +- ports/linux/guts/fcntl64.c | 2 +- ports/linux/guts/getpw.c | 2 +- ports/linux/guts/openat.c | 3 +-- ports/linux/openat2/guts/openat2.c | 3 +-- ports/linux/xattr/pseudo_wrappers.c | 3 +-- ports/unix/guts/getcwd.c | 6 +++--- ports/unix/guts/linkat.c | 2 +- ports/unix/guts/nftw_wrapper_base.c | 6 +++--- ports/unix/guts/symlinkat.c | 2 +- ports/unix/guts/tempnam.c | 2 +- ports/unix/guts/tmpnam.c | 2 +- ports/unix/guts/unlinkat.c | 2 +- pseudo_ipc.c | 2 +- pseudo_wrappers.c | 2 +- 16 files changed, 20 insertions(+), 24 deletions(-) diff --git a/ports/darwin/pseudo_wrappers.c b/ports/darwin/pseudo_wrappers.c index 3f05936..a7a1341 100644 --- a/ports/darwin/pseudo_wrappers.c +++ b/ports/darwin/pseudo_wrappers.c @@ -73,9 +73,8 @@ static int posix_permissions(const acl_header *header, int entries, int *extra, int *mode) { int acl_seen = 0; if (le32(header->version) != 2) { - pseudo_diag("Fatal: ACL support no available for header version %d.\n", + pseudo_critical("ACL support no available for header version %d.\n", le32(header->version)); - return 1; } *mode = 0; *extra = 0; diff --git a/ports/linux/guts/fcntl.c b/ports/linux/guts/fcntl.c index ffb50be..d6babb5 100644 --- a/ports/linux/guts/fcntl.c +++ b/ports/linux/guts/fcntl.c @@ -89,7 +89,7 @@ break; #endif default: - pseudo_diag("unknown fcntl argument %d, assuming long argument.\n", + pseudo_error("unknown fcntl argument %d, assuming long argument.\n", cmd); rc = real_fcntl(fd, cmd, arg); break; diff --git a/ports/linux/guts/fcntl64.c b/ports/linux/guts/fcntl64.c index 99de43d..169fc6d 100644 --- a/ports/linux/guts/fcntl64.c +++ b/ports/linux/guts/fcntl64.c @@ -89,7 +89,7 @@ break; #endif default: - pseudo_diag("unknown fcntl64 argument %d, assuming long argument.\n", + pseudo_error("unknown fcntl64 argument %d, assuming long argument.\n", cmd); rc = real_fcntl64(fd, cmd, arg); break; diff --git a/ports/linux/guts/getpw.c b/ports/linux/guts/getpw.c index 5aa0bca..111799e 100644 --- a/ports/linux/guts/getpw.c +++ b/ports/linux/guts/getpw.c @@ -12,7 +12,7 @@ static char pwbuf[PSEUDO_PWD_MAX]; struct passwd *pwp; - pseudo_diag("warning: unsafe getpw() called. hoping buf has at least %d chars.\n", + pseudo_warning("unsafe getpw() called. hoping buf has at least %d chars.\n", PSEUDO_PWD_MAX); rc = wrap_getpwuid_r(uid, &pwd, pwbuf, PSEUDO_PWD_MAX, &pwp); /* different error return conventions */ diff --git a/ports/linux/guts/openat.c b/ports/linux/guts/openat.c index 656ac2b..0a44063 100644 --- a/ports/linux/guts/openat.c +++ b/ports/linux/guts/openat.c @@ -112,9 +112,8 @@ * stack to stuff that's going to try to drop the lock. */ if (pseudo_getlock()) { - pseudo_diag("PANIC: after opening a readonly/writeonly FIFO (path '%s', fd %d, errno %d, saved errno %d), could not regain lock. unrecoverable. sorry. bye.\n", + pseudo_critical("after opening a readonly/writeonly FIFO (path '%s', fd %d, errno %d, saved errno %d), could not regain lock. unrecoverable. sorry. bye.\n", path, rc, errno, save_errno); - abort(); } errno = save_errno; } diff --git a/ports/linux/openat2/guts/openat2.c b/ports/linux/openat2/guts/openat2.c index a0acbe7..f1c523e 100644 --- a/ports/linux/openat2/guts/openat2.c +++ b/ports/linux/openat2/guts/openat2.c @@ -147,9 +147,8 @@ * stack to stuff that's going to try to drop the lock. */ if (pseudo_getlock()) { - pseudo_diag("PANIC: after opening a readonly/writeonly FIFO (path '%s', fd %d, errno %d, saved errno %d), could not regain lock. unrecoverable. sorry. bye.\n", + pseudo_critical("PANIC: after opening a readonly/writeonly FIFO (path '%s', fd %d, errno %d, saved errno %d), could not regain lock. unrecoverable. sorry. bye.\n", pseudo_path, rc, errno, save_errno); - abort(); } errno = save_errno; } diff --git a/ports/linux/xattr/pseudo_wrappers.c b/ports/linux/xattr/pseudo_wrappers.c index 0b65920..896c84d 100644 --- a/ports/linux/xattr/pseudo_wrappers.c +++ b/ports/linux/xattr/pseudo_wrappers.c @@ -66,9 +66,8 @@ static int posix_permissions(const acl_header *header, int entries, int *extra, int *mode) { int acl_seen = 0; if (le32(header->version) != 2) { - pseudo_diag("Fatal: ACL support not available for header version %d.\n", + pseudo_critical("Fatal: ACL support not available for header version %d.\n", le32(header->version)); - return -1; } *mode = 0; *extra = 0; diff --git a/ports/unix/guts/getcwd.c b/ports/unix/guts/getcwd.c index a5bf2ef..f9d6bfc 100644 --- a/ports/unix/guts/getcwd.c +++ b/ports/unix/guts/getcwd.c @@ -11,7 +11,7 @@ pseudo_debug(PDBGF_CLIENT, "wrap_getcwd: %p, %lu\n", (void *) buf, (unsigned long) size); if (!pseudo_cwd) { - pseudo_diag("Asked for CWD, but don't have it!\n"); + pseudo_error("Asked for CWD, but don't have it!\n"); errno = EACCES; return NULL; } @@ -33,13 +33,13 @@ if (size) { buf = malloc(size); } else { - pseudo_diag("can't figure out CWD: length %ld + 1 - %ld => %ld\n", + pseudo_error("can't figure out CWD: length %ld + 1 - %ld => %ld\n", (unsigned long) pseudo_cwd_len, (unsigned long) pseudo_chroot_len, (unsigned long) size); } if (!buf) { - pseudo_diag("couldn't allocate requested CWD buffer - need %ld byes\n", + pseudo_error("couldn't allocate requested CWD buffer - need %ld byes\n", (unsigned long) size); errno = ENOMEM; return NULL; diff --git a/ports/unix/guts/linkat.c b/ports/unix/guts/linkat.c index 60fbf63..ff707c8 100644 --- a/ports/unix/guts/linkat.c +++ b/ports/unix/guts/linkat.c @@ -82,7 +82,7 @@ rc2 = base_lstat(oldpath, &buf); } if (rc2 == -1) { - pseudo_diag("Fatal: Tried to stat '%s' after linking it, but failed: %s.\n", + pseudo_error("Fatal: Tried to stat '%s' after linking it, but failed: %s.\n", oldpath, strerror(errno)); errno = ENOENT; return rc2; diff --git a/ports/unix/guts/nftw_wrapper_base.c b/ports/unix/guts/nftw_wrapper_base.c index 000fa18..b9f761a 100644 --- a/ports/unix/guts/nftw_wrapper_base.c +++ b/ports/unix/guts/nftw_wrapper_base.c @@ -68,7 +68,7 @@ static void NFTW_DELETE_FN_NAME() { NFTW_STORAGE_ARRAY_NAME = NULL; --NFTW_STORAGE_ARRAY_SIZE; } else { - pseudo_diag("%s: Invalid callback storage content, can't find corresponding data", __func__); + pseudo_error("%s: Invalid callback storage content, can't find corresponding data", __func__); } return; } @@ -82,7 +82,7 @@ static void NFTW_DELETE_FN_NAME() { } if (found_idx == -1) { - pseudo_diag("%s: Invalid callback storage content, can't find corresponding data", __func__); + pseudo_error("%s: Invalid callback storage content, can't find corresponding data", __func__); return; } @@ -102,7 +102,7 @@ static int NFTW_CALLBACK_NAME(const char* fpath, const struct NFTW_STAT_STRUCT _ struct NFTW_STAT_STRUCT pseudo_sb; if (!NFTW_FIND_FN_NAME(&saved_details)) { - pseudo_diag("%s: Could not find corresponding callback!", __func__); + pseudo_error("%s: Could not find corresponding callback!", __func__); return -1; } diff --git a/ports/unix/guts/symlinkat.c b/ports/unix/guts/symlinkat.c index c96ff3e..5673912 100644 --- a/ports/unix/guts/symlinkat.c +++ b/ports/unix/guts/symlinkat.c @@ -38,7 +38,7 @@ #endif if (rc == -1) { int save_errno = errno; - pseudo_diag("symlinkat: couldn't stat '%s' even though symlink creation succeeded (%s).\n", + pseudo_warning("symlinkat: couldn't stat '%s' even though symlink creation succeeded (%s).\n", newpath, strerror(errno)); errno = save_errno; free(roldname); diff --git a/ports/unix/guts/tempnam.c b/ports/unix/guts/tempnam.c index 26ae3e1..e2d2c75 100644 --- a/ports/unix/guts/tempnam.c +++ b/ports/unix/guts/tempnam.c @@ -11,7 +11,7 @@ /* let gcc know we ignored these on purpose */ (void) template; (void) pfx; - pseudo_diag("tempnam() is so ludicrously insecure as to defy implementation."); + pseudo_warning("tempnam() is so ludicrously insecure as to defy implementation."); errno = ENOMEM; rc = NULL; diff --git a/ports/unix/guts/tmpnam.c b/ports/unix/guts/tmpnam.c index 190d260..60b66e0 100644 --- a/ports/unix/guts/tmpnam.c +++ b/ports/unix/guts/tmpnam.c @@ -11,7 +11,7 @@ /* let gcc know we're ignoring this */ (void) s; - pseudo_diag("tmpnam() is so ludicrously insecure as to defy implementation."); + pseudo_warning("tmpnam() is so ludicrously insecure as to defy implementation."); errno = ENOMEM; rc = NULL; diff --git a/ports/unix/guts/unlinkat.c b/ports/unix/guts/unlinkat.c index 7e4f87c..9889b2e 100644 --- a/ports/unix/guts/unlinkat.c +++ b/ports/unix/guts/unlinkat.c @@ -23,7 +23,7 @@ * with that flag unless the real AT functions exist, so * something must have gone horribly wrong.... */ - pseudo_diag("wrap_unlinkat called with flags (0x%x), path '%s'\n", + pseudo_info("wrap_unlinkat called with flags (0x%x), path '%s'\n", rflags, path ? path : ""); errno = ENOSYS; return -1; diff --git a/pseudo_ipc.c b/pseudo_ipc.c index 838eba2..e51fe0e 100644 --- a/pseudo_ipc.c +++ b/pseudo_ipc.c @@ -165,7 +165,7 @@ pseudo_msg_receive(int fd) { if (!incoming || header.pathlen >= incoming_pathlen) { newmsg = pseudo_msg_new(header.pathlen + 128, 0); if (!newmsg) { - pseudo_diag("Couldn't allocate header for path of %d bytes.\n", + pseudo_error("Couldn't allocate header for path of %d bytes.\n", (int) header.pathlen); return 0; } diff --git a/pseudo_wrappers.c b/pseudo_wrappers.c index 9ae1200..662c276 100644 --- a/pseudo_wrappers.c +++ b/pseudo_wrappers.c @@ -249,7 +249,7 @@ pseudo_magic() { static void pseudo_enosys(const char *func) { - pseudo_diag("pseudo: ENOSYS for '%s'.\n", func ? func : ""); + pseudo_info("pseudo: ENOSYS for '%s'.\n", func ? func : ""); char * value = pseudo_get_value("PSEUDO_ENOSYS_ABORT"); if (value) abort(); From patchwork Wed Jun 10 11:46:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Sakhonchik X-Patchwork-Id: 89666 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09DB2CD98C7 for ; Wed, 10 Jun 2026 11:47:36 +0000 (UTC) Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18636.1781092053259859233 for ; Wed, 10 Jun 2026 04:47:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=n2E/yoZF; spf=pass (domain: gmail.com, ip: 209.85.208.52, mailfrom: frezidok1@gmail.com) Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-68c5eecdd56so9984723a12.3 for ; Wed, 10 Jun 2026 04:47:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781092051; x=1781696851; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qk/E5viPgvkB9BF3ZT9EyDeixBzCKR/rUIoaut4QPtY=; b=n2E/yoZFglPAauPQ45FW1Nb7H59nNhfr/8ydQU4YgWFnq9uq6Dd24nD6VAetgul/HX sU7MRZizoqU7x1PE0HoDxupB6sLnQwOg1NitZX90UKFKa8VgDm3Cs0qp7l92biQE09g4 c9yFvTFrSCkyx80ysTxNnipHY8r4P96wPo2hAtWWl3mafPavF62/mY+oDFXXYgt0KO7D uxMnnhuDpQ1CU+w8nYF6EVlBnNEPq3ek3pdB8WqY5V+ww+EtT7yUdu0J+HFy9HkixNyk 0GiileDUHnMcMsCdo2LAVYTeF+m2NW4kMNI/FQFGETinjJRjFFDWZLp//29DXobhrqR0 FhEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781092051; x=1781696851; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qk/E5viPgvkB9BF3ZT9EyDeixBzCKR/rUIoaut4QPtY=; b=WZjg2dERGWIeHnaCrBN6SdWujdyTljekecOMIz1JvO2Sy5UjVTx3UpZ3zbJQ0fs7iT l1rXborJcP95jGuxWsP+NQqD905cPpkN3T6qcpxAVTf6btCB2B9yELinqCPOBbV41d7q wDmSihif+j5TJXqzbsqBKIdZwb6ywb6gnW8RMsfA6DBia6XpbhM1wCd5hadaNv0Z+e2w ttvam1NKRxRmYzm2J7iQNdofpIr4tKSF5bnrZa0taJnhsWXHPdb+BJUAC2ojLa/6THGM T6TOTJtIRE3la49VdO5VoWegJ9wT8cfvcGusVPWQWrbGtyWZmLKZyVc/RDx4GagN2PHF wM5A== X-Gm-Message-State: AOJu0Yw+oNywLWlnHR8IgIAWJEDzZJcp6cjhNf57qu8JBUTmh8ENjVQU n8rEXfn9LC/A7MfNcerpWm+cvEjafZkYC/0QQ8BqDeI9t7d5ebRWAwU3VO+PkgtX X-Gm-Gg: Acq92OHujx4URLYnlIC9c/z4O9VqDp93gKgmsO+XOsdkQ16qS2JDO6GHiGqeiV2JP/Z XxCQzRv+TOLA6N5Ft3kHAdQxBrwNd93btbT1TEe/ao1O6lPvK5b38oL6ZegVIWh4yYD1vfjpq0J 5rI540O122qT3d2Tr9yshONpcqy9aHILuLWc5r5/QvZzFRoUj2jtpBTvzx5LnWyPlcyRYsYnQoa Z6m827/czhuuNUXBQdNCDz4Oy6H/s/unlmMuC7hSgCUBEYoMTamCSiqOd8vZe151acn7LnYozba LuQcXC7HQUlS6nQXiOKJPrY198wNBQIi1JiM3usRG9o24AWkoSWH2VlHrxZEn3p10EGa39iufQO ugpefO6ESVpk3rOhHkspxYQ0/T5tVIPYSF6JFuN2OWZFoQf3qOZodnerXS2Nrl3ZhbZJfRTC2UQ vcNQWQ/mNu6WC2wgDUc7UAzjN7jdXo X-Received: by 2002:a05:6402:2789:b0:68a:f749:609c with SMTP id 4fb4d7f45d1cf-68fa52505f2mr11730451a12.21.1781092051359; Wed, 10 Jun 2026 04:47:31 -0700 (PDT) Received: from ubuntu1.. ([194.87.83.187]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6912faea64dsm5997164a12.19.2026.06.10.04.47.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2026 04:47:30 -0700 (PDT) From: frezidok1@gmail.com To: yocto-patches@lists.yoctoproject.org Cc: Dmitry Sakhonchik Subject: [pseudo] [PATCH 8/8] pseudo: Change pseudo_diag() name to pseudo_log() Date: Wed, 10 Jun 2026 14:46:10 +0300 Message-ID: <20260610114610.60776-8-frezidok1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260610114610.60776-1-frezidok1@gmail.com> References: <20260610114610.60776-1-frezidok1@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 10 Jun 2026 11:47:36 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/4199 From: Dmitry Sakhonchik Implements [YOCTO #12141] Signed-off-by: Dmitry Sakhonchik --- pseudo.h | 14 +++++++------- pseudo_util.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pseudo.h b/pseudo.h index d214ba2..92ae71e 100644 --- a/pseudo.h +++ b/pseudo.h @@ -34,7 +34,7 @@ extern unsigned long pseudo_util_severity_flags; extern int pseudo_util_debug_fd; extern int pseudo_disabled; extern int pseudo_allow_fsync; -extern int pseudo_diag(char *, ...) __attribute__ ((format (printf, 1, 2))); +extern int pseudo_log(char *, ...) __attribute__ ((format (printf, 1, 2))); extern int pseudo_evlog_internal(char *, ...) __attribute__ ((format (printf, 1, 2))); #define pseudo_evlog(x, ...) do { \ if (pseudo_util_evlog_flags & (x)) { pseudo_evlog_internal(__VA_ARGS__); } \ @@ -42,27 +42,27 @@ extern int pseudo_evlog_internal(char *, ...) __attribute__ ((format (printf, 1, extern void pseudo_evlog_dump(void); #ifndef NDEBUG #define pseudo_critical(fmt, ...) do { \ - pseudo_diag("CRITICAL: " fmt, ##__VA_ARGS__); \ + pseudo_log("CRITICAL: " fmt, ##__VA_ARGS__); \ abort(); \ } while (0) #define pseudo_error(fmt, ...) do { \ - pseudo_diag("ERROR: " fmt, ##__VA_ARGS__); \ + pseudo_log("ERROR: " fmt, ##__VA_ARGS__); \ } while (0) #define pseudo_warning(fmt, ...) do { \ if (pseudo_util_severity_flags & SEVERITYF_WARN) { \ - pseudo_diag("WARNING: " fmt, ##__VA_ARGS__); \ + pseudo_log("WARNING: " fmt, ##__VA_ARGS__); \ } \ } while (0) #define pseudo_info(fmt, ...) do { \ if (pseudo_util_severity_flags & SEVERITYF_INFO) { \ - pseudo_diag("INFO: " fmt, ##__VA_ARGS__); \ + pseudo_log("INFO: " fmt, ##__VA_ARGS__); \ } \ } while (0) #define pseudo_debug(x, ...) do { \ if ((x) & PDBGF_VERBOSE) { \ - if ((pseudo_util_debug_flags & PDBGF_VERBOSE) && (pseudo_util_debug_flags & ((x) & ~PDBGF_VERBOSE))) { pseudo_diag(__VA_ARGS__); } \ + if ((pseudo_util_debug_flags & PDBGF_VERBOSE) && (pseudo_util_debug_flags & ((x) & ~PDBGF_VERBOSE))) { pseudo_log(__VA_ARGS__); } \ } else { \ - if ((pseudo_util_debug_flags & (x)) || ((x) == 0)) { pseudo_diag(__VA_ARGS__); } \ + if ((pseudo_util_debug_flags & (x)) || ((x) == 0)) { pseudo_log(__VA_ARGS__); } \ } \ } while (0) #define pseudo_debug_call(x, fn, ...) do { \ diff --git a/pseudo_util.c b/pseudo_util.c index dbd979e..893a25b 100644 --- a/pseudo_util.c +++ b/pseudo_util.c @@ -528,7 +528,7 @@ pseudo_debug_clear(char *s) { } int -pseudo_diag(char *fmt, ...) { +pseudo_log(char *fmt, ...) { va_list ap; char debuff[8192]; int len;