Several follow-ups for recent header cleanups (#37785)

This commit is contained in:
Yu Watanabe
2025-06-10 01:01:05 +09:00
committed by GitHub
11 changed files with 12 additions and 14 deletions

View File

@@ -6,6 +6,7 @@
#include <errno.h> /* IWYU pragma: export */
#include <inttypes.h> /* IWYU pragma: export */
#include <limits.h> /* IWYU pragma: export */
#include <paths.h> /* IWYU pragma: export */
#include <stdarg.h> /* IWYU pragma: export */
#include <stdbool.h> /* IWYU pragma: export */
#include <stddef.h> /* IWYU pragma: export */

View File

@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <features.h>
#include <linux/if.h> /* IWYU pragma: export */
#define IF_NAMESIZE 16

View File

@@ -2,10 +2,6 @@
#include <unistd.h>
#if HAVE_SELINUX
#include <selinux/selinux.h>
#endif
#include "sd-messages.h"
#include "errno-util.h"

View File

@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/mman.h>
#include <sys/quota.h>
#include <sys/vfs.h>
#include "sd-bus.h"

View File

@@ -8,7 +8,6 @@
#include <pwd.h>
#include <sys/inotify.h>
#include <sys/ioctl.h>
#include <sys/quota.h>
#include <sys/stat.h>
#include "sd-bus.h"

View File

@@ -1,5 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/quota.h>
#include "btrfs-util.h"
#include "errno-util.h"

View File

@@ -1,8 +1,8 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/sockios.h>
#include <poll.h>
#include <sys/ioctl.h>
#include <sys/poll.h>
#include "sd-varlink.h"

View File

@@ -54,6 +54,12 @@ DLSYM_PROTOTYPE(crypt_token_json_get) = NULL;
DLSYM_PROTOTYPE(crypt_token_json_set) = NULL;
#if HAVE_CRYPT_TOKEN_MAX
DLSYM_PROTOTYPE(crypt_token_max) = NULL;
#else
int crypt_token_max(_unused_ const char *type) {
assert(streq(type, CRYPT_LUKS2));
return 32;
}
#endif
#if HAVE_CRYPT_TOKEN_SET_EXTERNAL_PATH
DLSYM_PROTOTYPE(crypt_token_set_external_path) = NULL;

View File

@@ -56,11 +56,7 @@ extern DLSYM_PROTOTYPE(crypt_token_json_set);
extern DLSYM_PROTOTYPE(crypt_token_max);
#else
/* As a fallback, use the same hard-coded value libcryptsetup uses internally. */
static inline int crypt_token_max(_unused_ const char *type) {
assert(streq(type, CRYPT_LUKS2));
return 32;
}
int crypt_token_max(_unused_ const char *type);
#define sym_crypt_token_max(type) crypt_token_max(type)
#endif
#if HAVE_CRYPT_TOKEN_SET_EXTERNAL_PATH

View File

@@ -21,6 +21,7 @@
#include "errno-util.h"
#include "libcrypt-util.h"
#include "log.h"
#include "random-util.h"
#include "string-util.h"
#include "strv.h"

View File

@@ -104,7 +104,7 @@ static int write_entry_wtmp(const struct utmpx *store) {
* simply appended to the end; i.e. basically a log. */
errno = 0;
updwtmpx(_PATH_WTMPX, store);
updwtmpx(WTMPX_FILE, store);
if (errno == ENOENT) {
/* If utmp/wtmp have been disabled, that's a good thing, hence ignore the error. */
log_debug_errno(errno, "Not writing wtmp: %m");