Zbigniew Jędrzejewski-Szmek
c5ed77b220
libsystemd: use _NEG_ macros, adjust some comments
...
No functional change.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek
d66ad6ff85
sd-id128: introduce ERRNO_IS_NEG_MACHINE_ID_UNSET
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek
13d84288bc
tree-wide: use cocinnelle to apply _NEG_ macros
2023-08-16 12:52:56 +02:00
Lennart Poettering
d1e8e8b5ae
tree-wide: drop _pure_ + _const_ from local, static functions
...
This is supposed to be a help for compilers to apply optimizations on
functions where they can't determine whether they are const/pure on
their own. For static, local functions the compiler can do this on its
own easily however, hence the decoration with pure/const is just noise.
Let's drop it, and let the compiler to its thing better.
(Use it for exported functions, since compilers can't 'reach-over' into
other modules to determine if they are pure, except if LTO is used)
2023-08-10 00:01:04 +08:00
Yu Watanabe
130c87b16a
meson: merge declarations of normal and test executables
2023-08-03 20:37:16 +09:00
Luca Boccassi
b0d3095fd6
Drop split-usr and unmerged-usr support
...
As previously announced, execute order 66:
https://lists.freedesktop.org/archives/systemd-devel/2022-September/048352.html
The meson options split-usr, rootlibdir and rootprefix become no-ops
that print a warning if they are set to anything other than the
default values. We can remove them in a future release.
2023-07-28 19:34:03 +01:00
Daan De Meyer
7ccb171c4c
Merge pull request #28359 from keszybz/ret-gather
...
Add RET_GATHER macro to make continue-but-remember-first-error functions easier
2023-07-28 14:28:35 +02:00
Luca Boccassi
de06b9a1b9
Merge pull request #28430 from keszybz/cleanups
...
Various small cleanups
2023-07-28 09:56:28 +01:00
Luca Boccassi
46021aaaa6
Merge pull request #28417 from bluca/coverity
...
Some coverity fixes
2023-07-28 09:56:08 +01:00
Zbigniew Jędrzejewski-Szmek
9194c1e697
sd-device, basic: align backslashes and drop unnecessary parens
...
Follow-up for a1af83728f
and 2507731374 .
2023-07-17 20:57:42 +02:00
Dmitry V. Levin
bb228f0ebc
sd-bus: fix use of ERRNO_IS_DISCONNECT()
...
Given that ERRNO_IS_DISCONNECT() also matches positive values,
make sure this macro is not called with arguments that do not have
errno semantics.
In this case the argument passed to ERRNO_IS_DISCONNECT() is the value
returned by bus_socket_process_watch_bind(), bus_socket_process_opening(),
and bus_socket_process_authenticating() which can legitimately return
positive values without errno semantics, so fix this by moving the
ERRNO_IS_DISCONNECT() invocation to the branch where the return value
is known to be negative.
2023-07-16 10:53:30 +00:00
Luca Boccassi
d80cc39558
bus: add some minimal bounds check on signatures
...
CID#1491292
CID#1491291
CID#1491290
CID#1491289
CID#1491284
CID#1491281
CID#1491280
CID#1491278
2023-07-16 11:32:54 +01:00
Yu Watanabe
4cbabc195c
sd-journal: fix 'the the'
2023-07-14 16:53:41 +09:00
Frantisek Sumsal
9e94023236
journal: clean up the FSS handling code a bit
2023-07-13 15:32:20 +02:00
Zbigniew Jędrzejewski-Szmek
9ef648cca1
various: use RET_GATHER
...
No functional change indentended.
2023-07-13 11:12:00 +02:00
Zbigniew Jędrzejewski-Szmek
09ace4c76d
sd-device: simplify code flow
...
This function was written as if it wanted to do some cleanup after exiting from
the loop, but that never happened.
2023-07-13 11:12:00 +02:00
Daan De Meyer
a1af83728f
device-util: Declare iterator variables inline
2023-07-12 20:05:18 +02:00
Luca Boccassi
79be4b7da8
Merge pull request #28255 from yuwata/sd-device-fix-clone
...
sd-device: fix device_clone_with_db()
2023-07-05 21:38:52 +01:00
Yu Watanabe
4a45a2e0e3
sd-journal: introduce SD_JOURNAL_TAKE_DIRECTORY_FD flag for sd_journal_open_directory_fd()
...
If it is called with the flag, then the provided file descriptor will be
owned by the sd_journal object, and will be closed in sd_journal_close().
2023-07-06 00:06:20 +09:00
Yu Watanabe
35e49f2856
sd-device: do not read uevent file in device_clone_with_db()
...
Follow-up for 381f6d4ba5 .
When the function is called, the device may be already removed, and
another device has the same syspath. Such situation can occur when a
partition removed and another is created. In that case, the sysfs paths
of the removed and newly created partitions can be same, but their
devnums are different, and thus the database files corresponding to the
devices are also different.
Fixes #27981 .
2023-07-05 23:45:57 +09:00
Yu Watanabe
86c2a76e09
Merge pull request #28132 from rpigott/dhcp-captive-portal
...
Implement RFC8910: captive portal dhcp options
2023-07-03 14:51:56 +09:00
Luca Boccassi
b9d29a2028
Merge pull request #28226 from mrc0mmand/coverity-fixes
...
A couple of Coverity-related fixes
2023-07-02 15:54:56 +01:00
Frantisek Sumsal
5000cea8d2
tree-wide: explicitly ignore return value in a couple more places
...
Resolves:
- CID#1490777
- CID#1498366
- CID#1508639
- CID#1509084
- CID#1509086
- CID#1509087
2023-07-02 12:22:45 +02:00
Zbigniew Jędrzejewski-Szmek
da89046643
tree-wide: "<n>bit" → "<n>-bit"
...
In some places, "<n> bits" is used when more appropriate.
2023-07-02 11:10:12 +01:00
Ronan Pigott
edb88a7201
network: Introduce UseCaptivePortal DHCPv4 option
...
Accepts a boolean. When enabled, UseCaptivePortal will request and
retain the captive portal configuration from the DHCP server.
2023-07-02 01:13:43 -07:00
Lennart Poettering
9a653235d1
sd-path: add support for XDG_STATE_HOME
2023-06-28 21:55:33 +02:00
Lennart Poettering
1db8c86196
Merge pull request #28179 from poettering/sysvgendeprecated
...
make systemd-sysv-generator even more deprecated
2023-06-28 09:37:42 +02:00
Yu Watanabe
16e1e4b3e7
meson: drop doubled empty line
2023-06-27 22:34:25 -06:00
Lennart Poettering
fba84e121b
journalctl: read env vars that override compiled catalog database and source files
...
This makes it a bit easier to test catalog files without installing
systemd.
2023-06-27 23:20:15 +02:00
Lennart Poettering
031d21bc45
Merge pull request #27843 from yuwata/usleep_safe
...
time-util: introduce usleep_safe()
2023-06-23 23:03:15 +02:00
Lennart Poettering
19b761a097
tree-wide: getpid() → getpid_cached()
...
This doesn't really matter, but let's be systematic and prefer
getpid_cached() in our codebase.
2023-06-22 17:07:59 -06:00
Yu Watanabe
4251512ea9
time-util: introduce usleep_safe()
...
We use usec_t for storing time value, which is 64bit.
However, usleep() takes useconds_t that is (typically?) 32bit.
Also, usleep() may only support the range [0, 1000000].
This introduce usleep_safe() which takes usec_t.
2023-06-22 15:33:56 +09:00
Yu Watanabe
50cf2032a0
sd-journal: verify journal file header in more detail
...
Fixes #27635 .
2023-06-21 18:25:07 -06:00
Lennart Poettering
7eb73fac04
Merge pull request #27927 from Geass-LL/main
...
core/unit: increase the GetNameOwner timeout to 90s
2023-06-16 09:38:53 +02:00
Frantisek Sumsal
9a27ef092e
tree-wide: fix a couple of typos
...
As reported by Fossies.org.
2023-06-15 20:52:45 +02:00
licunlong
bb30e58f64
sd-bus: make bus_add_match_full accept timeout
2023-06-15 18:15:23 +08:00
Lennart Poettering
e503019bc7
tree-wide: when in doubt use greek small letter mu rather than micro symbol
...
Doesn't really matter since the two unicode symbols are supposedly
equivalent, but let's better follow the unicode recommendations to
prefer greek small letter mu, as per:
https://www.unicode.org/reports/tr25
2023-06-14 10:23:56 +02:00
Daan De Meyer
17f5942f8a
Merge pull request #28010 from DaanDeMeyer/vsock-type
...
Vsock improvements
2023-06-13 15:41:58 +02:00
Daan De Meyer
7f78d3431b
sd-daemon: Add vsock fallback to SOCK_STREAM
...
SOCK_SEQPACKET is only supported on recent kernels. Let's add a
fallback to SOCK_STREAM if it is not supported.
To accomodate SOCK_STREAM, we also modify
pid_notify_with_fds_internal() to do sendmsg() in a loop as with
SOCK_STREAM, sendmsg() is not guaranteed to write all data in a single
syscall or fail otherwise.
2023-06-13 14:24:44 +02:00
Daan De Meyer
56d02f2969
sd-daemon: Use socket type from vsock address if set
...
If a socket type is explicitly provided in the vsock address, let's
make sure we try only that socket type.
2023-06-13 14:24:44 +02:00
Lennart Poettering
768fcd779f
socket: bump listen() backlog to INT_MAX everywhere
...
This is a rework of #24764 by Cristian Rodríguez
<crodriguez@owncloud.com >, which stalled.
Instead of assigning -1 we'll use a macro defined to INT_MAX however.
2023-06-13 14:17:25 +02:00
Yu Watanabe
2824385c4e
test: drop test for IFLA_NUM_RX_QUEUES
...
The attribute is not included in the netlink message if the kernel
built with CONFIG_RPS disabled.
Fixes #27969 .
2023-06-12 09:37:11 +02:00
Nick Rosbrook
c5ea147104
tree-wide: fix typos of "boottime"/"BOOTTIME"
2023-06-09 21:59:36 +02:00
Lennart Poettering
97c621b72d
sd-journal: when SD_JOURNAL_CURRENT_USER is set, and called from system UID, imply SD_JOURNAL_SYSTEM
...
Fixes : #26742 #23679
2023-06-08 09:33:02 +02:00
Thorsten Kukuk
403082602d
sd-login: add sd_session_get_leader interface
2023-06-07 09:33:36 +01:00
Lennart Poettering
4dcaab9c89
tree-wide: port various pieces of code over to ROUND_UP()
...
There's probably more than we can convert to this.
2023-06-02 16:43:39 +02:00
Yu Watanabe
45a6a2aace
sd-journal: fix assignment of tail entry offset
...
Fixes a bug introduced by 206f0f397e .
2023-06-01 17:04:10 +02:00
Yu Watanabe
17bd68ca74
Merge pull request #27874 from keszybz/test-bus-server-shortening
...
Simplify the code in test-bus-server
2023-06-01 21:10:55 +09:00
Zbigniew Jędrzejewski-Szmek
70b1676578
test-bus-server: simplify return value handling
...
Follow-up for f7794e423a .
2023-06-01 09:57:23 +02:00
Yu Watanabe
2485b7e2b8
tree-wide: use memstream-util
2023-06-01 06:48:47 +09:00