From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] lib/tst_tmpdir: tst_get_tmpdir() add error handing
Date: Mon, 9 Aug 2021 15:24:22 +0200 [thread overview]
Message-ID: <YREshhDwOKlFpbbi@yuki> (raw)
In-Reply-To: <b208d879-0d31-ff16-4ef0-d363e9a65c51@jv-coder.de>
Hi!
> > - return strdup(TESTDIR);
> > + ret = strdup(TESTDIR);
> Is a failing strdup here really a thing? The only reason strdup should
> be able to fail is with ENOMEM.
> The only way tst_brkm will work, if strdup fails here is, if TESTDIR is
> an extremely huge string (the NULL case is already handled above).
It's unlikely, but it may happen if:
* Someone runs memeater on the baground along with LTP
* And kernel is set not to overcommit
And in a case of the test lirary I would rather see it written so that
we check everything, even the unlikely errors.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2021-08-09 13:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-06 3:21 [LTP] [PATCH] lib/tst_tmpdir: tst_get_tmpdir() add error handing zhanglianjie
2021-08-06 4:40 ` Joerg Vehlow
2021-08-06 5:42 ` zhanglianjie
2021-08-09 13:24 ` Cyril Hrubis [this message]
2021-08-09 13:29 ` Cyril Hrubis
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=YREshhDwOKlFpbbi@yuki \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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.