Patches for Yocto layers and components that do not have their own list
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@kernel.crashing.org>
To: yocto-patches@lists.yoctoproject.org
Cc: richard.purdie@linuxfoundation.org, frezidok1@gmail.com
Subject: [pseudo][PATCH v2 10/23] wrappers: Change pseudo_diag() calls to appropriate macros
Date: Fri,  3 Jul 2026 13:40:42 -0500	[thread overview]
Message-ID: <1783104055-19005-11-git-send-email-mark.hatle@kernel.crashing.org> (raw)
In-Reply-To: <1783104055-19005-1-git-send-email-mark.hatle@kernel.crashing.org>

From: Dmitry Sakhonchik <frezidok1@gmail.com>

Implements [YOCTO #12141]

Signed-off-by: Dmitry Sakhonchik <frezidok1@gmail.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
 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 : "<nil>");
 		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 : "<nil>");
+	pseudo_info("pseudo: ENOSYS for '%s'.\n", func ? func : "<nil>");
 	char * value = pseudo_get_value("PSEUDO_ENOSYS_ABORT");
 	if (value)
 		abort();
-- 
1.8.3.1



  parent reply	other threads:[~2026-07-03 18:41 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-03 18:40 [pseudo][PATCH v2 00/23] Create new pseudo 1.99.0 version Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 01/23] Makefile.in: Move version to 1.99.0 to prep for 2.0 development Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 02/23] pseudo_util: Add log severity flags Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 03/23] pseudo: Add new logging macros Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 04/23] pseudo_util: Change pseudo_diag() calls to appropriate " Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 05/23] pseudo_db: Change pseudo_diag() calls to appropriate macros Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 06/23] pseudo_client: " Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 07/23] pseudo_server: " Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 08/23] pseudo.c: " Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 09/23] pseudolog.c: " Mark Hatle
2026-07-03 18:40 ` Mark Hatle [this message]
2026-07-03 18:40 ` [pseudo][PATCH v2 11/23] pseudo: Change pseudo_diag() name to pseudo_log() Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 12/23] pseudo_util: Add default log severity values Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 13/23] pseudo_util.c: strchr now returns const char Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 14/23] test/test-openat2-func.c: Remove unusuaed saved_errno Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 15/23] pseudo.h: Avoid accessing unallocated memory Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 16/23] pseudo_util: Avoid accidental free calls for without_libpseudo() Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 17/23] pseudo_util: Ensure pseudo_setupenvp handles memory consistently Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 18/23] pseudo_util: Avoid a memory leak in pseudo_dropenv() Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 19/23] pseudo_util: Clean up memory handling for setupenvp results Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 20/23] exec*: Replace bash workaround to avoid memory corruption Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 21/23] pseudo_util: Correctly free memory allocated by pseudo_setupenvp Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 22/23] test-bash-exec-env: Add bash env test case Mark Hatle
2026-07-03 18:40 ` [pseudo][PATCH v2 23/23] test: various: Move to makefile compilation Mark Hatle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1783104055-19005-11-git-send-email-mark.hatle@kernel.crashing.org \
    --to=mark.hatle@kernel.crashing.org \
    --cc=frezidok1@gmail.com \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=yocto-patches@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox