summaryrefslogtreecommitdiff
path: root/src/shared/bus-wait-for-jobs.c
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: simplify x ? x : y to x ?: y where applicableFrantisek Sumsal2023-03-181-2/+2
|
* tree-wide: use ASSERT_PTR moreDavid Tardon2022-09-131-2/+1
|
* dbus-wait-for-jobs: add extra_args to bus_wait_for_jobs_one()Luca Boccassi2021-12-301-2/+2
| | | | And pass it through to bus_wait_for_jobs()
* Merge pull request #18863 from keszybz/cmdline-escapingLennart Poettering2021-05-071-1/+1
|\ | | | | Escape command lines properly
| * Flagsify EscapeStyle and make ESCAPE_BACKSLASH_ONELINE implicitZbigniew Jędrzejewski-Szmek2021-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | I want to tweak behaviour further, and that'll be easier when "style" is converted to a bitfield. Some callers used ESCAPE_BACKSLASH_ONELINE, and others not. But the ones that didn't, simply didn't care, because the argument was assumed to be one-line anyway (e.g. a service name). In environment-generator, this could make a difference. But I think it's better to escape the newlines there too. So newlines are now always escaped, to simplify the code and the test matrix.
* | basic/log: assert that 0 is not passed as errno, except in test codeZbigniew Jędrzejewski-Szmek2021-04-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's assert if we ever happen to pass 0 to one of the log functions. With the preceding commit to return -EIO from log_*(), passing 0 wouldn't affect the return value any more, but it is still most likely an error. The unit test code is an exception: we fairly often pass the return value to print it, before checking what it is. So let's assert that we're not passing 0 in non-test code. As with the previous check for %m, this is only done in developer mode. We are depending on external code setting errno correctly for us, which might not always be true, and which we can't test, so we shouldn't assert, but just handle this gracefully. I did a bunch of greps to try to figure out if there are any places where we're passing 0 on purpose, and couldn't find any. The one place that failed in tests is adjusted. About "zerook" in the name: I wanted the suffix to be unambiguous. It's a single "word" because each of the words in log_full_errno is also meaningful, and having one term use two words would be confusing.
* | tree-wide: avoid uninitialized warning on _cleanup_ variablesLuca Boccassi2021-04-141-1/+1
|/ | | | | | | With some versions of the compiler, the _cleanup_ attr makes it think the variable might be freed/closed when uninitialized, even though it cannot happen. The added cost is small enough to be worth the benefit, and optimized builds will help reduce it even further.
* tree-wide: use UINT64_MAX or friendsYu Watanabe2021-03-051-1/+1
|
* tree-wide: return NULL from freeing functionsZbigniew Jędrzejewski-Szmek2021-02-161-3/+3
| | | | | | I started working on this because I wanted to change how DEFINE_TRIVIAL_CLEANUP_FUNC is defined. Even independently of that change, it's nice to make make things more consistent and predictable.
* Improve instructions for debugging failing serviceSebastiaan van Stijn2020-12-241-4/+6
| | | | | | | | | | | | | | | In situations where a service fails to start, systemd suggests the user to use "journalctl -xe" to get details about the failure. While running this command does provide some additional details, most of the information is similar to what was already printed when the service fails. often the actual reason for the failure can be found in the logs of the service that fails to start. This patch updates the wording to suggest using "-u" to view the service logs instead. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* basic/set: let set_put_strdup() create the set with string hash opsZbigniew Jędrzejewski-Szmek2020-05-061-8/+2
| | | | | | | | | | | | | | | | | | If we're using a set with _put_strdup(), most of the time we want to use string hash ops on the set, and free the strings when done. This defines the appropriate a new string_hash_ops_free structure to automatically free the keys when removing the set, and makes set_put_strdup() and set_put_strdupv() instantiate the set with those hash ops. hashmap_put_strdup() was already doing something similar. (It is OK to instantiate the set earlier, possibly with a different hash ops structure. set_put_strdup() will then use the existing set. It is also OK to call set_free_free() instead of set_free() on a set with string_hash_ops_free, the effect is the same, we're just overriding the override of the cleanup function.) No functional change intended.
* shared: add some minor commentsLennart Poettering2019-04-021-0/+4
|
* shared: split out code to wait for jobs to complet into its own source fileLennart Poettering2019-03-131-0/+333
It's complex enough and quite a few functions. Let's hence split this out. No code change, just some rearranging of source files.