Commit Graph
46910 Commits
Author SHA1 Message Date
Mike Yuan da6c52c57c various: don't use close_nointr if retval is not checked anyway 2023-12-28 20:44:01 +08:00
Mike Yuan 1189815a6b logind-session-device: use _cleanup_close_ 2023-12-28 20:43:42 +08:00
Mike Yuan 3760416ee8 shared/async: use safe_close where appropriate 2023-12-28 18:26:52 +08:00
Mike Yuan 1cbd441b09 fdset: use FOREACH_ARRAY at one more place 2023-12-28 18:26:52 +08:00
Mike Yuan 1276e63370 fd-util: modernization 2023-12-28 18:26:52 +08:00
Chris Simons 9ef362bf3d machinectl: add restart convenience alias (#30625) 2023-12-28 07:09:42 +09:00
Yu Watanabe 1a4b0459f6 network/address: unconditionally check if address is ready
Previously, we checked if the address is ready only when it is an IPv6
address. But, IPv4 address never enter tentative state, hence the check
for an IPv4 address is effectively equivalent to the one for IPv6.
So, let's unify the check. This does not change any effective behavior.
2023-12-28 07:08:37 +09:00
Yu Watanabe 3a30d81238 Merge pull request #30643 from bluca/completion
bash completion additions for systemctl/systemd-analyze
2023-12-28 04:10:20 +09:00
Luca Boccassi 5df839e99f analyze: allow --no-legend with architectures verb
It prints a table with a header, allow omitting it

Follow-up for fb8cc599ed
2023-12-27 17:50:07 +01:00
Mike Yuan fe33920c2a sleep: don't log duplicate error
write_resume_config() logs error on its own.
2023-12-27 22:38:43 +08:00
Mike Yuan 6e819bd2bd hibernate-util: remove unused code
All callers of write_resume_config() pass non-NULL device.
2023-12-27 22:38:42 +08:00
Mike Yuan 66b9956082 hibernate-util: make sure we use blockdev path for HibernationDevice.path
Before this commit, this field could spuriously contain the path of the
swapfile.
2023-12-27 22:38:42 +08:00
Yu Watanabe 51dfa75c6e Merge pull request #30639 from mrc0mmand/more-cocci-shenanigans
Another batch of Coccinelle tweaks
2023-12-27 20:33:46 +09:00
Frantisek Sumsal 321e64dc67 tpm2-util: declare the cleanup attribute first
As we do everywhere else (apart from it being incosistent, the switched
order also makes Coccinelle unhappy).
2023-12-27 11:15:48 +01:00
Frantisek Sumsal 8f07111aa8 bootctl: add a missing space 2023-12-27 11:15:48 +01:00
Frantisek Sumsal b8e0dd3939 test: use timestamp_is_set() 2023-12-27 11:15:48 +01:00
Frantisek Sumsal cfae9ec203 test: use set_isempty() in one more place 2023-12-27 11:15:48 +01:00
Frantisek Sumsal 6f8b3838c9 test: use IN_SET()/ERRNO_IS_NEG_*() more 2023-12-27 11:15:48 +01:00
Frantisek Sumsal c83f4220a1 tree-wide: use IN_SET() more 2023-12-27 11:15:48 +01:00
Luca Boccassi 74ce6bbdee Merge pull request #30631 from yuwata/network-address-free
network/address: tiny cleanups for address_free()
2023-12-26 19:21:15 +01:00
Mike Yuan e14348c616 sleep: connect to correct bus when locking homed-managed homes
Partially reverts 122f6f1eaa

Fixes https://github.com/systemd/systemd/issues/29938#issuecomment-1869508708
2023-12-26 18:53:03 +01:00
Yu Watanabe fe3fcb9492 Merge pull request #30633 from mrc0mmand/cocci-shenanigans
coccinelle: rework how we run the Coccinelle transformations
2023-12-26 05:45:58 +09:00
Frantisek Sumsal 8451e720d8 systemctl: use SYNTHETIC_ERRNO() 2023-12-25 19:51:43 +01:00
Frantisek Sumsal 0b3c270896 modules-load: simplify OOM check 2023-12-25 18:26:59 +01:00
Frantisek Sumsal f2d0e2e5f5 sd-bus: drop unnecessary braces 2023-12-25 18:26:59 +01:00
Frantisek Sumsal 50f605bfe6 network: use timestamp_is_set() in one more place 2023-12-25 18:26:59 +01:00
Frantisek Sumsal 78bc04cf12 tree-wide: use strndupa_safe() in a couple more cases 2023-12-25 18:26:59 +01:00
Frantisek Sumsal 34e2897f51 nspawn: log & return in a single statement 2023-12-25 18:26:59 +01:00
Frantisek Sumsal c490b6ddc2 tree-wide: use IOVEC_MAKE() in a couple more places 2023-12-25 18:26:59 +01:00
Frantisek Sumsal dd1b1dae7e test: use FLAGS_SET() in one more place 2023-12-25 18:26:59 +01:00
Frantisek Sumsal cd1c510f0c test: use ERRNO_IS_NEG_NOT_SUPPORTED() in one more place 2023-12-25 18:26:59 +01:00
Frantisek Sumsal 6f7936cf57 killall: fix errno check 2023-12-25 18:26:59 +01:00
Frantisek Sumsal 4b68f70829 network: ENOTSUP -> EOPNOTSUPP 2023-12-25 18:26:59 +01:00
Frantisek Sumsal f51aec74c9 tree-wide: shorten a couple of ternary expressions 2023-12-25 18:26:59 +01:00
Frantisek Sumsal 0a6a59650e tree-wide: drop !! casts to booleans 2023-12-25 18:26:59 +01:00
Mike Yuan 245841a872 core/unit: don't log 0 values in unit_log_resources
Prompted by #30573
2023-12-25 23:19:44 +09:00
Yu Watanabe 372acaad58 network: use RET_GATHER() macro 2023-12-25 22:02:14 +08:00
Yu Watanabe f089d3ebd5 network/address: move post-processes on address removal to address_drop()
For consistency with other follow-up processes after address removal.

No functional change, just refactoring and preparation for later
commits.
2023-12-25 20:19:40 +09:00
Yu Watanabe 8ae3a4f5e2 network/address: also drop reference for DHCP server address
The Address object should never freed after it is referenced.
So, this should not change any behavior. Just for safety.
2023-12-25 20:19:40 +09:00
Mike Yuan 38617c516a various: use FOREACH_ARRAY more
Prompted by #30622
2023-12-25 20:17:48 +09:00
Yu Watanabe 287a5f1cff Merge pull request #30628 from YHNdnzj/format-table-improvement
Some improvements for format-table
2023-12-25 20:01:32 +09:00
Mike Yuan 0a0f49556f Merge pull request #30622 from yuwata/space
tree-wide: drop unnecessary space or insert missing space
2023-12-25 17:52:48 +08:00
Mike Yuan 8ba111463d core,format-table: use strna/ersatz for formatting fdstore dump
Currently, the code doesn't handle anonymous inodes correctly.
2023-12-25 17:47:18 +08:00
Mike Yuan 2413a0fab4 format-table: introduce table_isempty and use it where appropriate 2023-12-25 17:47:18 +08:00
Yu Watanabe c01a5c0527 siphash24: introduce siphash24_compress_typesafe() macro
To prevent copy-and-paste mistake.

This also introduce in_addr_hash_func().

No functional change, just refactoring.
2023-12-25 15:38:59 +09:00
Frantisek Sumsal ac1b7b9e19 resolve: don't add sockets to the graveyard on shutdown
Since in that case the event loop is already finished and we'd hit an
assertion:

[ 1295.993300] testsuite-75.sh[50]: + systemctl stop systemd-resolved.service
[ 1296.005152] systemd-resolved[298]: Assertion 'e->state != SD_EVENT_FINISHED' failed at src/libsystemd/sd-event/sd-event.c:1252, function sd_event_add_io(). Aborting.

Thread 1 (Thread 0x7f17d25e2940 (LWP 298)):
 #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
 #1  0x00007f17d16ac8a3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
 #2  0x00007f17d165c668 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
 #3  0x00007f17d16444b8 in __GI_abort () at abort.c:79
 #4  0x00007f17d2402d2d in log_assert_failed (text=<optimized out>, file=<optimized out>, line=<optimized out>, func=<optimized out>) at ../build/src/basic/log.c:968
 #5  0x00007f17d240401c in log_assert_failed_return (text=text@entry=0x7f17d2533f13 "e->state != SD_EVENT_FINISHED", file=file@entry=0x7f17d25195d9 "src/libsystemd/sd-event/sd-event.c", line=line@entry=1252, func=func@entry=0x7f17d2567260 <__func__.140> "sd_event_add_io") at ../build/src/basic/log.c:987
 #6  0x00007f17d24d011a in sd_event_add_io (e=0x55e5cb497270, ret=0x55e5cb4a5120, fd=fd@entry=26, events=events@entry=1, callback=callback@entry=0x55e5caff5466 <on_io_event>, userdata=0x55e5cb4a5110) at ../build/src/libsystemd/sd-event/sd-event.c:1252
 #7  0x000055e5caff571c in manager_add_socket_to_graveyard (m=0x55e5cb43cf00, fd=26) at ../build/src/resolve/resolved-socket-graveyard.c:117
 #8  0x000055e5cafd4253 in dns_transaction_close_connection (t=t@entry=0x55e5cb57c7d0, use_graveyard=use_graveyard@entry=true) at ../build/src/resolve/resolved-dns-transaction.c:78
 #9  0x000055e5cafd8444 in dns_transaction_complete (t=t@entry=0x55e5cb57c7d0, state=state@entry=DNS_TRANSACTION_ABORTED) at ../build/src/resolve/resolved-dns-transaction.c:427
 #10 0x000055e5cafc4969 in dns_scope_abort_transactions (s=s@entry=0x55e5cb4b1a70) at ../build/src/resolve/resolved-dns-scope.c:91
 #11 0x000055e5cafc6aee in dns_scope_free (s=0x55e5cb4b1a70) at ../build/src/resolve/resolved-dns-scope.c:106
 #12 0x000055e5cafe72d1 in link_free (l=0x55e5cb4a5160) at ../build/src/resolve/resolved-link.c:94
 #13 0x000055e5cafedefc in manager_free (m=0x55e5cb43cf00) at ../build/src/resolve/resolved-manager.c:697
 #14 0x000055e5caff99b6 in manager_freep (p=p@entry=0x7ffd71fab8f8) at ../build/src/resolve/resolved-manager.h:198
 #15 0x000055e5caff9d66 in run (argc=argc@entry=1, argv=argv@entry=0x7ffd71faba78) at ../build/src/resolve/resolved.c:25
 #16 0x000055e5caff9fe3 in main (argc=1, argv=0x7ffd71faba78) at ../build/src/resolve/resolved.c:99

Resolves: #30618
2023-12-25 15:38:26 +09:00
Yu Watanabe 07e8c3055d tree-wide: drop several doubled space 2023-12-25 02:13:49 +09:00
Yu Watanabe b3a9d980f3 tree-wide: drop space between variable and an increment/decrement 2023-12-25 01:56:40 +09:00
Yu Watanabe 1d03d970a1 tree-wide: insert space after for and switch 2023-12-25 01:29:38 +09:00
Yu Watanabe 6ae5d4b52f coccinelle: convert hashmap_size() == 0 or friends
Addresses https://github.com/systemd/systemd/pull/30567#issuecomment-1866631816.
2023-12-25 00:47:42 +09:00