From: Li Wang via ltp <ltp@lists.linux.it>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] syscalls: newuname01: Convert to the new library.
Date: Thu, 5 Mar 2026 09:51:45 +0800 [thread overview]
Message-ID: <aajhsZYkb9WqTho2@redhat.com> (raw)
In-Reply-To: <20260304161425.12461-1-chrubis@suse.cz>
> + * Verify that uname() succeeds and correctly identifies the system as Linux.
> + * The rest of the values, when possible, are matched againts the strings from
^ against
> -int main(int ac, char **av)
> -{
> - struct utsname name;
> - int lc;
> + SAFE_FILE_SCANF("/proc/sys/kernel/hostname", "%1023[^\n]", proc_val);
> + TST_EXP_EQ_STR(name->nodename, proc_val);
>
> - tst_parse_opts(ac, av, NULL, NULL);
> + SAFE_FILE_SCANF("/proc/sys/kernel/osrelease", "%1023[^\n]", proc_val);
> + TST_EXP_EQ_STR(name->release, proc_val);
>
> - setup();
> + SAFE_FILE_SCANF("/proc/sys/kernel/version", "%1023[^\n]", proc_val);
> + TST_EXP_EQ_STR(name->version, proc_val);
We'd better clear proc_val between reads:
proc_val[0] = '\0';
Otherwise looks good:
Reviewed-by: Li Wang <liwang@redhat.com>
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-03-05 1:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 16:14 [LTP] [PATCH] syscalls: newuname01: Convert to the new library Cyril Hrubis
2026-03-05 1:51 ` Li Wang via ltp [this message]
2026-03-05 14:25 ` Cyril Hrubis
2026-03-06 2:58 ` Li Wang via ltp
2026-03-12 13:26 ` Andrea Cervesato via ltp
2026-04-07 12:08 ` 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=aajhsZYkb9WqTho2@redhat.com \
--to=ltp@lists.linux.it \
--cc=chrubis@suse.cz \
--cc=liwang@redhat.com \
/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