[LTP] [PATCH 0/2] Fix proc parsing in newuname01
Cyril Hrubis
chrubis@suse.cz
Thu Apr 9 12:30:39 CEST 2026
Turns out some of the strings in procfs can be empty (file with just a
newline) and in such case scanf("%s", ...) fails to read the file while
what we needed instead is a function that would produce an empty string.
This patchset addds such function and makes use of it in the
newuname01 test.
Cyril Hrubis (2):
lib: safe_file_ops: Add SAFE_FILE_READ_STR()
syscalls: newuname01: Fix fail on empty domainname
include/tst_safe_file_ops.h | 21 ++++++++++++++++
lib/safe_file_ops.c | 24 +++++++++++++++++++
.../kernel/syscalls/newuname/newuname01.c | 8 +++----
3 files changed, 49 insertions(+), 4 deletions(-)
--
2.52.0
More information about the ltp
mailing list