qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] hw/s390x/ccw: Cleanup basename() and dirname()
@ 2023-12-21 17:19 Zhao Liu
  2023-12-21 17:19 ` [PATCH 1/2] hw/s390x/ccw: Replace basename() with g_path_get_basename() Zhao Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Zhao Liu @ 2023-12-21 17:19 UTC (permalink / raw)
  To: Eric Farman, Matthew Rosato, Thomas Huth, Halil Pasic,
	Christian Borntraeger, Richard Henderson, David Hildenbrand,
	Ilya Leoshkevich, qemu-s390x, qemu-devel
  Cc: Cédric Le Goater, Zhao Liu

From: Zhao Liu <zhao1.liu@intel.com>

As commit 3e015d815b3f ("use g_path_get_basename instead of basename")
said, g_path_get_basename() and g_path_get_dirname() should be preferred
over basename() and dirname(), since g_path_get_basename() and
g_path_get_dirname() are portable utility functions that have the
advantage of not modifing the string argument.

But commit 3e015d815b3f missed a use of dirname() and basename() in
hw/s390x/ccw.

And basename() (in vfio/container) caused compile breakage with the Musl
C library [1].

To avoid similar breakage and improve portability, replace basename()
and dirname() with g_path_get_basename() and g_path_get_dirname().

[1]: https://lore.kernel.org/all/20231212010228.2701544-1-raj.khem@gmail.com/

---
Zhao Liu (2):
  hw/s390x/ccw: Replace basename() with g_path_get_basename()
  hw/s390x/ccw: Replace dirname() with g_path_get_dirname()

 hw/s390x/s390-ccw.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-01-02  8:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-21 17:19 [PATCH 0/2] hw/s390x/ccw: Cleanup basename() and dirname() Zhao Liu
2023-12-21 17:19 ` [PATCH 1/2] hw/s390x/ccw: Replace basename() with g_path_get_basename() Zhao Liu
2024-01-02  8:29   ` Cédric Le Goater
2023-12-21 17:19 ` [PATCH 2/2] hw/s390x/ccw: Replace dirname() with g_path_get_dirname() Zhao Liu
2024-01-02  8:29   ` Cédric Le Goater
2023-12-21 21:29 ` [PATCH 0/2] hw/s390x/ccw: Cleanup basename() and dirname() Eric Farman
2023-12-22  2:41   ` Zhao Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).