Commit Graph

9 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
454318d3e8 various: use strdup_to() in various obvious cases
strdup_to() returns 0 on success and here we convert obvious blocks
which either return -ENOMEM or 0.
2024-03-20 15:13:44 +01:00
Lennart Poettering
d80e2a1ed3 devnum-util: add new devnum_is_zero() helper 2023-03-29 18:27:05 +02:00
Daan De Meyer
f461a28da7 chase-symlinks: Rename chase_symlinks() to chase()
Chasing symlinks is a core function that's used in a lot of places
so it deservers a less verbose names so let's rename it to chase()
and chaseat().

We also slightly change the pattern used for the chaseat() helpers
so we get chase_and_openat() and similar.
2023-03-24 13:43:51 +01:00
Yu Watanabe
4492b5d804 devnum-util: split-out device_path_make_inaccessible() 2022-08-28 09:08:21 +09:00
Devendra Tewari
0f79b3469f systemd-growfs: use sd_device_new_from_devnum()
Use sd_device_new_from_devnum() instead of
device_path_make_major_minor_sysfs().
2022-08-26 20:33:03 +01:00
Devendra Tewari
aa181897cf systemd-growfs: remove dependency on udev symlinks
systemd-growfs currently requires that udev ran first to work (because
/dev/block/ symlinks must exist) but that is not what happens when
we're not using initrd and systemd is PID1.
2022-08-24 21:42:16 +01:00
Lennart Poettering
02b9047edf devnum-util: catch potential stack overruns early 2022-04-13 16:26:31 +02:00
Lennart Poettering
ec61371fe6 devnum-util: define helper macros for formatting devnum major/minor pairs
And port some parts over.
2022-04-13 16:26:31 +02:00
Lennart Poettering
7176f06c9e basic: split out dev_t related calls into new devno-util.[ch]
No actual code changes, just splitting out of some dev_t handling
related calls from stat-util.[ch], they are quite a number already, and
deserve their own module now I think.

Also, try to settle on the name "devnum" as the name for the concept,
instead of "devno" or "dev" or "devid". "devnum" is the name exported in
udev APIs, hence probably best to stick to that. (this just renames a
few symbols to "devum", local variables are left untouched, to make the
patch not too invasive)

No actual code changes.
2022-04-13 16:26:31 +02:00