Reverend Homer
8fb3f00997
tree-wide: replace all readdir cycles with FOREACH_DIRENT{,_ALL} ( #4853 )
2016-12-09 10:04:30 +01:00
Zbigniew Jędrzejewski-Szmek
f97b34a629
Rename formats-util.h to format-util.h
...
We don't have plural in the name of any other -util files and this
inconsistency trips me up every time I try to type this file name
from memory. "formats-util" is even hard to pronounce.
2016-11-07 10:15:08 -05:00
Zbigniew Jędrzejewski-Szmek
605405c6cc
tree-wide: drop NULL sentinel from strjoin
...
This makes strjoin and strjoina more similar and avoids the useless final
argument.
spatch -I . -I ./src -I ./src/basic -I ./src/basic -I ./src/shared -I ./src/shared -I ./src/network -I ./src/locale -I ./src/login -I ./src/journal -I ./src/journal -I ./src/timedate -I ./src/timesync -I ./src/nspawn -I ./src/resolve -I ./src/resolve -I ./src/systemd -I ./src/core -I ./src/core -I ./src/libudev -I ./src/udev -I ./src/udev/net -I ./src/udev -I ./src/libsystemd/sd-bus -I ./src/libsystemd/sd-event -I ./src/libsystemd/sd-login -I ./src/libsystemd/sd-netlink -I ./src/libsystemd/sd-network -I ./src/libsystemd/sd-hwdb -I ./src/libsystemd/sd-device -I ./src/libsystemd/sd-id128 -I ./src/libsystemd-network --sp-file coccinelle/strjoin.cocci --in-place $(git ls-files src/*.c)
git grep -e '\bstrjoin\b.*NULL' -l|xargs sed -i -r 's/strjoin\((.*), NULL\)/strjoin(\1)/'
This might have missed a few cases (spatch has a really hard time dealing
with _cleanup_ macros), but that's no big issue, they can always be fixed
later.
2016-10-23 11:43:27 -04:00
Stefan Schweter
629ff674ac
tree-wide: remove consecutive duplicate words in comments
2016-10-04 17:06:25 +02:00
Zbigniew Jędrzejewski-Szmek
31b14fdb6f
Merge pull request #3777 from poettering/id128-rework
...
uuid/id128 code rework
2016-07-22 21:18:41 -04:00
Lennart Poettering
83f8e80857
core: support percentage specifications on TasksMax=
...
This adds support for a TasksMax=40% syntax for specifying values relative to
the system's configured maximum number of processes. This is useful in order to
neatly subdivide the available room for tasks within containers.
2016-07-22 15:33:12 +02:00
Lennart Poettering
910fd145f4
sd-id128: split UUID file read/write code into new id128-util.[ch]
...
We currently have code to read and write files containing UUIDs at various
places. Unify this in id128-util.[ch], and move some other stuff there too.
The new files are located in src/libsystemd/sd-id128/ (instead of src/shared/),
because they are actually the backend of sd_id128_get_machine() and
sd_id128_get_boot().
In follow-up patches we can use this reduce the code in nspawn and
machine-id-setup by adopted the common implementation.
2016-07-22 12:59:36 +02:00
Lennart Poettering
d8cf2ac79b
util: introduce physical_memory_scale() to unify how we scale by physical memory
...
The various bits of code did the scaling all different, let's unify this,
given that the code is not trivial.
2016-06-14 20:01:45 +02:00
Lennart Poettering
d9ab2bcf05
util: when determining the amount of memory on this system, take cgroup limit into account
...
When determining the amount of RAM in the system, let's make sure we also read
the root-level cgroup memory limit into account. This isn't particularly useful
on the host, but in containers it makes sure that whatever memory the container
got assigned is actually used for RAM size calculations.
2016-06-14 19:50:38 +02:00
Ivan Shapovalov
dcd6145002
core: parse `rd.rescue` and `rd.emergency` as initrd-specific shorthands ( #3488 )
...
Typing `rd.rescue` is easier than `rd.systemd.unit=rescue.target`.
2016-06-13 16:28:42 +02:00
Zbigniew Jędrzejewski-Szmek
55cdd057b9
tree-wide: rename hidden_file to hidden_or_backup_file and optimize
...
In standard linux parlance, "hidden" usually means that the file name starts
with ".", and nothing else. Rename the function to convey what the function does
better to casual readers.
Stop exposing hidden_file_allow_backup which is rather ugly and rewrite
hidden_file to extract the suffix first. Note that hidden_file_allow_backup
excluded files with "~" at the end, which is quite confusing. Let's get
rid of it before it gets used in the wrong place.
2016-04-28 08:25:17 -04:00
Zbigniew Jędrzejewski-Szmek
78e334b50f
basic/util: silence stupid gcc warnings about unitialized variable
2016-04-13 08:56:44 -04:00
Lennart Poettering
27c06cb516
core: rework reboot parameter logic a bit
...
Always warn if something fails, and clarify that the involved utility functions
do so in their name.
Drop the REBOOT_PARAM_FILE macro. We don't do this for other flag file paths
like this, so don't do this for this one either. The path isn't configurable
anyway, hence let's make this easier to read by avoiding this one indirection.
2016-04-12 13:43:32 +02:00
Lennart Poettering
8612da973d
core: be more paranoid when mixing umask and fopen()
...
Let's be extra careful with the umask when we use simple fopen(), as this
creates files with 0777 by default.
2016-04-12 13:43:32 +02:00
Zbigniew Jędrzejewski-Szmek
94edd38e1d
basic/util: check return value of dup2 in fork_agent()
...
CID #1304689 .
2016-04-08 21:08:29 -04:00
Daniel Mack
b26fa1a2fb
tree-wide: remove Emacs lines from all files
...
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file.
2016-02-10 13:41:57 +01:00
Zbigniew Jędrzejewski-Szmek
b326715278
tree-wide: check if errno is greater than zero (2)
...
Compare errno with zero in a way that tells gcc that
(if the condition is true) errno is positive.
2016-01-13 15:10:17 -05:00
Thomas Hindoe Paaboel Andersen
93cc7779e0
basic: re-sort includes
...
My previous patch to only include what we use accidentially placed
the added inlcudes in non-sorted order.
2015-12-01 23:40:17 +01:00
Thomas Hindoe Paaboel Andersen
11c3a36649
basic: include only what we use
...
This is a cleaned up result of running iwyu but without forward
declarations on src/basic.
2015-11-30 21:51:03 +01:00
Lennart Poettering
4a0b58c4a3
tree-wide: use right cast macros for UIDs, GIDs and PIDs
2015-11-17 00:52:10 +01:00
Thomas Hindoe Paaboel Andersen
cf0fbc49e6
tree-wide: sort includes
...
Sort the includes accoding to the new coding style.
2015-11-16 22:09:36 +01:00
Lennart Poettering
4fee397531
util-lib: move fdname_is_valid() to fd-util.[ch]
2015-10-27 14:57:44 +01:00
Lennart Poettering
7b3e062cb6
process-util: move a couple of process-related calls over
2015-10-27 14:24:58 +01:00
Lennart Poettering
405f8907b9
process-util: actually move rename_process() over
...
The prototype was moved long ago, actually move the definition over now,
too.
2015-10-27 13:56:40 +01:00
Lennart Poettering
4e036b7a96
mount-util: move fstype_is_network() and name_to_handle_at() definitions over
2015-10-27 13:45:53 +01:00
Lennart Poettering
b5efdb8af4
util-lib: split out allocation calls into alloc-util.[ch]
2015-10-27 13:45:53 +01:00
Lennart Poettering
7d50b32a12
util-lib: split out globbing related calls into glob-util.[ch]
2015-10-27 13:25:58 +01:00
Lennart Poettering
49cf4170d0
util-lib: move web-related calls into web-util.[ch]
2015-10-27 13:25:57 +01:00
Lennart Poettering
7ccbd1ae84
util-lib: split out syslog-related calls into syslog-util.[ch]
2015-10-27 13:25:57 +01:00
Lennart Poettering
7f4b3c5ea3
util-lib: move running_in_chroot() into virt.[ch]
...
It's a very weak kind of virtualization, after all.
2015-10-27 13:25:57 +01:00
Lennart Poettering
4e731273ed
util-lib: move /proc/cmdline parsing code to proc-cmdline.[ch]
2015-10-27 13:25:57 +01:00
Lennart Poettering
d4510856a0
util-lib: move is_main_thread() to process-util.[ch]
2015-10-27 13:25:57 +01:00
Lennart Poettering
8752c5752f
util-lib: move more locale-related calls to locale-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
8b43440b7e
util-lib: move string table stuff into its own string-table.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
8fcde01280
util-lib: split stat()/statfs()/stavfs() related calls into stat-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
f3e2e81d53
util: move string_is_safe() to string-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
f4f15635ec
util-lib: move a number of fs operations into fs-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
c8b3094de5
util-lib: split out file attribute calls to chattr-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
89a5a90cb0
util-lib: split xattr-related calls into xattr-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
a09561746f
util-lib: introduce dirent-util.[ch] for directory entry calls
...
Also, move a couple of more path-related functions to path-util.c.
2015-10-27 13:25:56 +01:00
Lennart Poettering
78f22b973f
util-lib: split out resource limits related calls into rlimit-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
e929bee09a
util-lib: move take_password_lock() to user-util.[ch]
...
Also, rename it take_etc_passwd_lock(), in order to make it more
expressive.
2015-10-27 13:25:55 +01:00
Lennart Poettering
bb15fafe9c
util: move filename_is_valid() and path_is_safe() to path-util.[ch]
2015-10-27 13:25:55 +01:00
Lennart Poettering
4349cd7c1d
util-lib: move mount related utility calls to mount-util.[ch]
2015-10-27 13:25:55 +01:00
Lennart Poettering
6550203eb4
util-lib: move fstab_node_to_udev_node() to fstab-util.[ch]
2015-10-27 13:25:55 +01:00
Lennart Poettering
0d39fa9c69
util-lib: move more file I/O related calls into fileio.[ch]
2015-10-27 13:25:55 +01:00
Lennart Poettering
5f311f8c0e
util: remove path_get_parent(), in favour of dirname_malloc()
...
We don't need two functions that do essentialy the same, hence drop
path_get_parent(), and stick to dirname_malloc(), but move it to
path-util.[ch].
2015-10-27 13:25:55 +01:00
Lennart Poettering
e4e73a6325
util-lib: split out hex/dec/oct encoding/decoding into its own file
2015-10-27 13:25:55 +01:00
Lennart Poettering
6bedfcbb29
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]
2015-10-27 13:25:55 +01:00
Lennart Poettering
4d0d3d41d2
process-util: move more process related calls to process-util.[ch]
2015-10-26 01:24:39 +01:00