Thread (78 messages) 78 messages, 12 authors, 2025-10-24

Re: [PATCH 32/32] selftests/namespaces: add file handle selftests

From: Bart Van Assche <bvanassche@acm.org>
Date: 2025-09-10 21:46:49
Also in: cgroups, linux-block, linux-fsdevel, linux-kselftest, linux-nfs, lkml

On 9/10/25 7:37 AM, Christian Brauner wrote:
+	snprintf(ns_path, sizeof(ns_path), "/proc/self/ns/net");
+	ns_fd = open(ns_path, O_RDONLY);
Here and also in TEST(nsfs_uts_handle), ns_path is not modified. Does
this mean that "/proc/self/ns/net" can be stored in a static const char
array and also that the snprintf() call can be left out? In case I would
have missed the reason why the path is copied, how about using
asprintf() or strdup() instead of snprintf()?

Thanks,

Bart.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help