DPDK patches and discussions
 help / color / mirror / Atom feed
From: John Levon <john.levon@nutanix.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, kkanas@marvell.com,
	John Levon <john.levon@nutanix.com>
Subject: [dpdk-dev] [PATCH] app/test: quieten noise while forking
Date: Sun,  1 Aug 2021 18:53:25 +0100	[thread overview]
Message-ID: <20210801175325.12163-1-john.levon@nutanix.com> (raw)
In-Reply-To: <11971053.QyrIl9gFXQ@thomas>

When closing file descriptors post-fork, ignore "." and ".." directory
entries, so the test log doesn't have distracting errors like:

Error converting name fd 0 .:
Error converting name fd 0 ..:

Signed-off-by: John Levon <john.levon@nutanix.com>
---
 app/test/process.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/app/test/process.h b/app/test/process.h
index 0ed91a939e..5b10cf64df 100644
--- a/app/test/process.h
+++ b/app/test/process.h
@@ -90,6 +90,11 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 			}
 
 			while ((dirent = readdir(dir)) != NULL) {
+
+				if (strcmp(dirent->d_name, ".") == 0 ||
+					strcmp(dirent->d_name, "..") == 0)
+					continue;
+
 				errno = 0;
 				fd = strtol(dirent->d_name, &endptr, 10);
 				if (errno != 0 || endptr[0] != '\0') {
-- 
2.25.1


  reply	other threads:[~2021-08-01 17:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26 12:17 John Levon
2021-07-31 17:48 ` Thomas Monjalon
2021-08-01 17:53   ` John Levon [this message]
2021-08-02 11:22     ` Thomas Monjalon

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=20210801175325.12163-1-john.levon@nutanix.com \
    --to=john.levon@nutanix.com \
    --cc=dev@dpdk.org \
    --cc=kkanas@marvell.com \
    --cc=thomas@monjalon.net \
    /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;
as well as URLs for NNTP newsgroup(s).