mirror of
https://github.com/systemd/systemd.git
synced 2026-08-12 22:17:19 +00:00
tree-wide: sizeof() fixes
- TIME_T_MAX is always time_t so the check in time-util.c was redundant
- quota-util.c was zero-ing a pointer
- smbios11.c was calling sizeof(pointer)
(cherry picked from commit 33b0642e6a)
This commit is contained in:
committed by
Luca Boccassi
parent
26ce84e7c3
commit
4e86d48d3c
@@ -1744,8 +1744,6 @@ int time_change_fd(void) {
|
||||
|
||||
_cleanup_close_ int fd = -EBADF;
|
||||
|
||||
assert_cc(sizeof(time_t) == sizeof(TIME_T_MAX));
|
||||
|
||||
/* Uses TFD_TIMER_CANCEL_ON_SET to get notifications whenever CLOCK_REALTIME makes a jump relative to
|
||||
* CLOCK_MONOTONIC. */
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ int quota_query_proj_id(int fd, uint32_t proj_id, struct dqblk *ret_req) {
|
||||
|
||||
r = quotactl_fd_with_fallback(fd, QCMD_FIXED(Q_GETQUOTA, PRJQUOTA), proj_id, ret_req);
|
||||
if (r == -ESRCH || ERRNO_IS_NEG_NOT_SUPPORTED(r) || ERRNO_IS_NEG_PRIVILEGE(r)) {
|
||||
zero(ret_req);
|
||||
*ret_req = (struct dqblk) {};
|
||||
return false;
|
||||
}
|
||||
if (r < 0)
|
||||
|
||||
@@ -40,7 +40,7 @@ int read_smbios11_field(unsigned i, size_t max_size, char **ret_data, size_t *re
|
||||
AT_FDCWD, p,
|
||||
/* offset = */ UINT64_MAX,
|
||||
max_size >= SIZE_MAX - offsetof(struct dmi_field_header, contents) ? SIZE_MAX :
|
||||
sizeof(dmi_field_header) + max_size,
|
||||
sizeof(struct dmi_field_header) + max_size,
|
||||
/* flags = */ 0,
|
||||
/* bind_name = */ NULL,
|
||||
(char**) &data, &size);
|
||||
|
||||
Reference in New Issue
Block a user