From: Crystal Wood <crwood@redhat.com>
To: John Kacur <jkacur@gmail.com>, Lukas Beckmann <lbckmnn@mailbox.org>
Cc: John Kacur <jkacur@redhat.com>,
rt-users <linux-rt-users@vger.kernel.org>
Subject: Re: [PATCH 2/2] cyclictest: simplify rstat_setup
Date: Tue, 10 Mar 2026 08:30:16 -0500 [thread overview]
Message-ID: <9ff2d632fbbc58fda5509a26f0dee26d6c3aefcd.camel@redhat.com> (raw)
In-Reply-To: <f504e9c5-95c9-79e4-0274-f639a4829af9@gmail.com>
On Mon, 2026-03-09 at 18:55 -0400, John Kacur wrote:
>
> On Sun, 1 Mar 2026, Lukas Beckmann wrote:
> > +static void rstat_setup(void)
> > +{
> > + int fd;
> > + pid_t pid;
> >
> > - if (mptr == (void*)-1)
> > - fprintf(stderr, "ERROR: mmap, %s\n", strerror(errno));
> > + pid = getpid();
> >
> > - return mptr;
> > -}
> > + snprintf(shm_name, SHM_BUF_SIZE, "%s%d", "/cyclictest", pid);
> >
> > -static int rstat_mlock(void *mptr)
> > -{
> > - int err;
>
> errno = 0 before the call to shm_unlink for good defensive programming
> other than that the patch looks good, I will do a little more testing
Defensive against the library returning -1 without setting errno? Seems
a bit paranoid and cluttery... all for the payoff of an "ERROR:
shm_unlink Success" message if it ever does happen *and* the old errno
happened to be ENOENT.
And the current code uses it even in places that print the message
regardless.
-Crystal
next prev parent reply other threads:[~2026-03-10 13:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-01 21:24 [PATCH 0/2] cyclictest: fix growing shm stat file Lukas Beckmann
2026-03-01 21:24 ` [PATCH 1/2] " Lukas Beckmann
2026-03-09 22:54 ` John Kacur
2026-03-01 21:24 ` [PATCH 2/2] cyclictest: simplify rstat_setup Lukas Beckmann
2026-03-09 22:55 ` John Kacur
2026-03-10 13:30 ` Crystal Wood [this message]
2026-03-10 16:18 ` John Kacur
2026-03-10 16:57 ` Crystal Wood
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=9ff2d632fbbc58fda5509a26f0dee26d6c3aefcd.camel@redhat.com \
--to=crwood@redhat.com \
--cc=jkacur@gmail.com \
--cc=jkacur@redhat.com \
--cc=lbckmnn@mailbox.org \
--cc=linux-rt-users@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.