clang-tidy: Enable more warnings (#39910)
This commit is contained in:
+28
-3
@@ -2,10 +2,33 @@
|
||||
---
|
||||
Checks: '
|
||||
-*,
|
||||
misc-header-include-cycle,
|
||||
readability-duplicate-include,
|
||||
bugprone-argument-comment,
|
||||
misc-include-cleaner
|
||||
bugprone-chained-comparison,
|
||||
bugprone-integer-division,
|
||||
bugprone-misplaced-operator-in-strlen-in-alloc,
|
||||
bugprone-misplaced-pointer-arithmetic-in-alloc,
|
||||
bugprone-posix-return,
|
||||
bugprone-redundant-branch-condition,
|
||||
bugprone-sizeof-expression,
|
||||
bugprone-suspicious-enum-usage,
|
||||
bugprone-suspicious-semicolon,
|
||||
bugprone-suspicious-string-compare,
|
||||
bugprone-swapped-arguments,
|
||||
bugprone-tautological-type-limits,
|
||||
bugprone-unused-return-value,
|
||||
misc-header-include-cycle,
|
||||
misc-include-cleaner,
|
||||
misc-misplaced-const,
|
||||
misc-use-internal-linkage,
|
||||
readability-avoid-const-params-in-decls,
|
||||
readability-const-return-type,
|
||||
readability-duplicate-include,
|
||||
readability-inconsistent-declaration-parameter-name,
|
||||
readability-misleading-indentation,
|
||||
readability-named-parameter,
|
||||
readability-redundant-casting,
|
||||
readability-redundant-declaration,
|
||||
readability-redundant-function-ptr-dereference
|
||||
'
|
||||
CheckOptions:
|
||||
misc-include-cleaner.MissingIncludes: 'false'
|
||||
@@ -28,7 +51,9 @@ CheckOptions:
|
||||
varlink-idl-common\.h;
|
||||
unistd\.h
|
||||
'
|
||||
misc-header-include-cycle.IgnoredFilesList: 'glib-2.0'
|
||||
WarningsAsErrors: '*'
|
||||
ExcludeHeaderFilterRegex: 'blkid\.h|gmessages\.h|gstring\.h'
|
||||
HeaderFileExtensions:
|
||||
- h
|
||||
ImplementationFileExtensions:
|
||||
|
||||
@@ -17,6 +17,7 @@ ARGS=(
|
||||
"--optimization=3 -Db_lto=false -Dtpm2=disabled -Dlibfido2=disabled -Dp11kit=disabled -Defi=false -Dbootloader=disabled"
|
||||
"--optimization=3 -Dfexecve=true -Dstandalone-binaries=true -Dstatic-libsystemd=true -Dstatic-libudev=true"
|
||||
"-Db_ndebug=true"
|
||||
"--auto-features=disabled -Dcompat-mutable-uid-boundaries=true"
|
||||
)
|
||||
PACKAGES=(
|
||||
cryptsetup-bin
|
||||
|
||||
@@ -77,7 +77,7 @@ jobs:
|
||||
mkosi box -- ruff check src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
|
||||
|
||||
- name: Configure meson
|
||||
run: mkosi box -- env CC=clang CXX=clang++ meson setup -Dlocalegen-path=/usr/bin/locale-gen -Dcompat-mutable-uid-boundaries=true build
|
||||
run: mkosi box -- env CC=clang CXX=clang++ meson setup build
|
||||
|
||||
- name: Run clang-tidy
|
||||
run: mkosi box -- meson test -C build --suite=clang-tidy --print-errorlogs --no-stdsplit --quiet
|
||||
|
||||
@@ -28,7 +28,6 @@ typedef void* (*mfree_func_t)(void *p);
|
||||
})
|
||||
|
||||
#define _DEFINE_TRIVIAL_REF_FUNC(type, name, scope) \
|
||||
/* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \
|
||||
scope type *name##_ref(type *p) { \
|
||||
if (!p) \
|
||||
return NULL; \
|
||||
@@ -43,7 +42,6 @@ typedef void* (*mfree_func_t)(void *p);
|
||||
}
|
||||
|
||||
#define _DEFINE_TRIVIAL_UNREF_FUNC(type, name, free_func, scope) \
|
||||
/* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \
|
||||
scope type *name##_unref(type *p) { \
|
||||
if (!p) \
|
||||
return NULL; \
|
||||
|
||||
@@ -38,4 +38,4 @@ int fs_type_from_string(const char *name, const statfs_f_type_t **ret);
|
||||
bool fs_in_group(const struct statfs *s, enum FilesystemGroups fs_group);
|
||||
|
||||
/* gperf prototypes */
|
||||
const struct FilesystemMagic* filesystems_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
|
||||
const struct FilesystemMagic* filesystems_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
|
||||
|
||||
@@ -1135,17 +1135,17 @@ bool oom_score_adjust_is_valid(int oa) {
|
||||
return oa >= OOM_SCORE_ADJ_MIN && oa <= OOM_SCORE_ADJ_MAX;
|
||||
}
|
||||
|
||||
unsigned long personality_from_string(const char *p) {
|
||||
unsigned long personality_from_string(const char *s) {
|
||||
Architecture architecture;
|
||||
|
||||
if (!p)
|
||||
if (!s)
|
||||
return PERSONALITY_INVALID;
|
||||
|
||||
/* Parse a personality specifier. We use our own identifiers that indicate specific ABIs, rather than just
|
||||
* hints regarding the register size, since we want to keep things open for multiple locally supported ABIs for
|
||||
* the same register size. */
|
||||
|
||||
architecture = architecture_from_string(p);
|
||||
architecture = architecture_from_string(s);
|
||||
if (architecture < 0)
|
||||
return PERSONALITY_INVALID;
|
||||
|
||||
@@ -1247,8 +1247,8 @@ bool nice_is_valid(int n) {
|
||||
return n >= PRIO_MIN && n < PRIO_MAX;
|
||||
}
|
||||
|
||||
bool sched_policy_is_valid(int i) {
|
||||
return IN_SET(i, SCHED_OTHER, SCHED_BATCH, SCHED_IDLE, SCHED_FIFO, SCHED_RR, SCHED_EXT);
|
||||
bool sched_policy_is_valid(int policy) {
|
||||
return IN_SET(policy, SCHED_OTHER, SCHED_BATCH, SCHED_IDLE, SCHED_FIFO, SCHED_RR, SCHED_EXT);
|
||||
}
|
||||
|
||||
bool sched_policy_supported(int policy) {
|
||||
|
||||
@@ -101,8 +101,8 @@ bool oom_score_adjust_is_valid(int oa);
|
||||
* personality we're interested in. */
|
||||
#define OPINIONATED_PERSONALITY_MASK 0xFFUL
|
||||
|
||||
unsigned long personality_from_string(const char *p);
|
||||
const char* personality_to_string(unsigned long);
|
||||
unsigned long personality_from_string(const char *s);
|
||||
const char* personality_to_string(unsigned long p);
|
||||
|
||||
int safe_personality(unsigned long p);
|
||||
int opinionated_personality(unsigned long *ret);
|
||||
@@ -124,10 +124,10 @@ int pid_compare_func(const pid_t *a, const pid_t *b);
|
||||
|
||||
bool nice_is_valid(int n) _const_;
|
||||
|
||||
bool sched_policy_is_valid(int i) _const_;
|
||||
bool sched_policy_supported(int i);
|
||||
int sched_get_priority_min_safe(int i);
|
||||
int sched_get_priority_max_safe(int i);
|
||||
bool sched_policy_is_valid(int policy) _const_;
|
||||
bool sched_policy_supported(int policy);
|
||||
int sched_get_priority_min_safe(int policy);
|
||||
int sched_get_priority_max_safe(int policy);
|
||||
|
||||
#define PID_AUTOMATIC ((pid_t) INT_MIN) /* special value indicating "acquire pid from connection peer" */
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ ssize_t string_table_lookup_from_string_fallback(const char * const *table, size
|
||||
|
||||
/* For basic lookup tables with strictly enumerated entries */
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name, type, scope) \
|
||||
/* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \
|
||||
scope const char* name##_to_string(type i) { \
|
||||
return string_table_lookup_to_string(name##_table, ELEMENTSOF(name##_table), i); \
|
||||
}
|
||||
@@ -31,7 +30,6 @@ ssize_t string_table_lookup_from_string_fallback(const char * const *table, size
|
||||
}
|
||||
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name, type, max, scope) \
|
||||
/* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \
|
||||
scope int name##_to_string_alloc(type i, char **ret) { \
|
||||
return string_table_lookup_to_string_fallback(name##_table, ELEMENTSOF(name##_table), i, max, ret); \
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ bool terminal_is_dumb(void);
|
||||
bool dev_console_colors_enabled(void);
|
||||
|
||||
int get_ctty_devnr(pid_t pid, dev_t *ret);
|
||||
int get_ctty(pid_t, dev_t *ret_devnr, char **ret);
|
||||
int get_ctty(pid_t pid, dev_t *ret_devnr, char **ret);
|
||||
|
||||
int getttyname_malloc(int fd, char **ret);
|
||||
int getttyname_harder(int fd, char **ret);
|
||||
|
||||
@@ -173,7 +173,7 @@ char* save_timezone(void);
|
||||
|
||||
bool clock_supported(clockid_t clock);
|
||||
|
||||
usec_t usec_shift_clock(usec_t, clockid_t from, clockid_t to);
|
||||
usec_t usec_shift_clock(usec_t x, clockid_t from, clockid_t to);
|
||||
|
||||
int get_timezone(char **ret);
|
||||
const char* etc_localtime(void);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#if ENABLE_COMPAT_MUTABLE_UID_BOUNDARIES
|
||||
#include <threads.h>
|
||||
|
||||
#include "chase.h"
|
||||
@@ -7,6 +8,8 @@
|
||||
#include "fileio.h"
|
||||
#include "log.h"
|
||||
#include "string-util.h"
|
||||
#endif
|
||||
|
||||
#include "uid-classification.h"
|
||||
#include "user-util.h"
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "macro-fundamental.h"
|
||||
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \
|
||||
/* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \
|
||||
scope const char* name##_to_string(type i) { \
|
||||
assert(i >= 0 && i < (type) ELEMENTSOF(name##_table)); \
|
||||
return name##_table[i]; \
|
||||
|
||||
@@ -398,7 +398,7 @@ assert_cc(sizeof(long long) == sizeof(intmax_t));
|
||||
#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
|
||||
|
||||
DISABLE_WARNING_REDUNDANT_DECLS;
|
||||
void free(void *p);
|
||||
void free(void *p); /* NOLINT (readability-redundant-declaration) */
|
||||
REENABLE_WARNING;
|
||||
|
||||
#define mfree(memory) \
|
||||
|
||||
@@ -682,7 +682,7 @@ static int acquire_home(
|
||||
|
||||
if (FLAGS_SET(flags, ACQUIRE_MUST_AUTHENTICATE))
|
||||
pam_syslog(pamh, LOG_ERR, "Failed to prompt for password/prompt.");
|
||||
else if (debug)
|
||||
else
|
||||
pam_debug_syslog(pamh, debug, "Failed to prompt for password/prompt.");
|
||||
|
||||
return home_not_active || home_locked ? PAM_PERM_DENIED : PAM_CONV_ERR;
|
||||
|
||||
@@ -342,7 +342,7 @@ static int on_first_event(sd_event_source *s, void *userdata) {
|
||||
return r;
|
||||
|
||||
if (arg_follow && !c->has_cursor && !arg_since_set) {
|
||||
r = sd_journal_get_cursor(c->journal, /* ret_cursor= */ NULL);
|
||||
r = sd_journal_get_cursor(c->journal, /* ret= */ NULL);
|
||||
if (r == -EADDRNOTAVAIL) {
|
||||
/* If we shall operate in --follow mode, and we are unable to get a cursor after
|
||||
* doing our first round of output, then this means there was no data to show
|
||||
|
||||
@@ -1232,7 +1232,7 @@ _public_ int sd_journal_previous_skip(sd_journal *j, uint64_t skip) {
|
||||
return real_journal_next_skip(j, DIRECTION_UP, skip);
|
||||
}
|
||||
|
||||
_public_ int sd_journal_get_cursor(sd_journal *j, char **ret_cursor) {
|
||||
_public_ int sd_journal_get_cursor(sd_journal *j, char **ret) {
|
||||
Object *o;
|
||||
int r;
|
||||
|
||||
@@ -1246,10 +1246,10 @@ _public_ int sd_journal_get_cursor(sd_journal *j, char **ret_cursor) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (!ret_cursor)
|
||||
if (!ret)
|
||||
return 0;
|
||||
|
||||
if (asprintf(ret_cursor,
|
||||
if (asprintf(ret,
|
||||
"s=%s;i=%"PRIx64";b=%s;m=%"PRIx64";t=%"PRIx64";x=%"PRIx64,
|
||||
SD_ID128_TO_STRING(j->current_file->header->seqnum_id), le64toh(o->entry.seqnum),
|
||||
SD_ID128_TO_STRING(o->entry.boot_id), le64toh(o->entry.monotonic),
|
||||
@@ -2813,7 +2813,7 @@ static bool field_is_valid(const char *field) {
|
||||
return true;
|
||||
}
|
||||
|
||||
_public_ int sd_journal_get_data(sd_journal *j, const char *field, const void **data, size_t *length) {
|
||||
_public_ int sd_journal_get_data(sd_journal *j, const char *field, const void **ret_data, size_t *ret_size) {
|
||||
JournalFile *f;
|
||||
size_t field_length;
|
||||
Object *o;
|
||||
@@ -2822,8 +2822,8 @@ _public_ int sd_journal_get_data(sd_journal *j, const char *field, const void **
|
||||
assert_return(j, -EINVAL);
|
||||
assert_return(!journal_origin_changed(j), -ECHILD);
|
||||
assert_return(field, -EINVAL);
|
||||
assert_return(data, -EINVAL);
|
||||
assert_return(length, -EINVAL);
|
||||
assert_return(ret_data, -EINVAL);
|
||||
assert_return(ret_size, -EINVAL);
|
||||
assert_return(field_is_valid(field), -EINVAL);
|
||||
|
||||
f = j->current_file;
|
||||
@@ -2856,8 +2856,8 @@ _public_ int sd_journal_get_data(sd_journal *j, const char *field, const void **
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
*data = d;
|
||||
*length = l;
|
||||
*ret_data = d;
|
||||
*ret_size = l;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -2865,15 +2865,15 @@ _public_ int sd_journal_get_data(sd_journal *j, const char *field, const void **
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
_public_ int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t *length) {
|
||||
_public_ int sd_journal_enumerate_data(sd_journal *j, const void **ret_data, size_t *ret_size) {
|
||||
JournalFile *f;
|
||||
Object *o;
|
||||
int r;
|
||||
|
||||
assert_return(j, -EINVAL);
|
||||
assert_return(!journal_origin_changed(j), -ECHILD);
|
||||
assert_return(data, -EINVAL);
|
||||
assert_return(length, -EINVAL);
|
||||
assert_return(ret_data, -EINVAL);
|
||||
assert_return(ret_size, -EINVAL);
|
||||
|
||||
f = j->current_file;
|
||||
if (!f)
|
||||
@@ -2901,8 +2901,8 @@ _public_ int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t
|
||||
return r;
|
||||
assert(r > 0);
|
||||
|
||||
*data = d;
|
||||
*length = l;
|
||||
*ret_data = d;
|
||||
*ret_size = l;
|
||||
|
||||
j->current_field++;
|
||||
|
||||
@@ -2912,11 +2912,11 @@ _public_ int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t
|
||||
return 0;
|
||||
}
|
||||
|
||||
_public_ int sd_journal_enumerate_available_data(sd_journal *j, const void **data, size_t *length) {
|
||||
_public_ int sd_journal_enumerate_available_data(sd_journal *j, const void **ret_data, size_t *ret_size) {
|
||||
for (;;) {
|
||||
int r;
|
||||
|
||||
r = sd_journal_enumerate_data(j, data, length);
|
||||
r = sd_journal_enumerate_data(j, ret_data, ret_size);
|
||||
if (r >= 0)
|
||||
return r;
|
||||
if (!JOURNAL_ERRNO_IS_UNAVAILABLE_FIELD(r))
|
||||
@@ -3469,11 +3469,11 @@ _public_ int sd_journal_enumerate_unique(
|
||||
}
|
||||
}
|
||||
|
||||
_public_ int sd_journal_enumerate_available_unique(sd_journal *j, const void **data, size_t *size) {
|
||||
_public_ int sd_journal_enumerate_available_unique(sd_journal *j, const void **ret_data, size_t *ret_size) {
|
||||
for (;;) {
|
||||
int r;
|
||||
|
||||
r = sd_journal_enumerate_unique(j, data, size);
|
||||
r = sd_journal_enumerate_unique(j, ret_data, ret_size);
|
||||
if (r >= 0)
|
||||
return r;
|
||||
if (!JOURNAL_ERRNO_IS_UNAVAILABLE_FIELD(r))
|
||||
@@ -3492,12 +3492,12 @@ _public_ void sd_journal_restart_unique(sd_journal *j) {
|
||||
j->unique_file_lost = false;
|
||||
}
|
||||
|
||||
_public_ int sd_journal_enumerate_fields(sd_journal *j, const char **field) {
|
||||
_public_ int sd_journal_enumerate_fields(sd_journal *j, const char **ret) {
|
||||
int r;
|
||||
|
||||
assert_return(j, -EINVAL);
|
||||
assert_return(!journal_origin_changed(j), -ECHILD);
|
||||
assert_return(field, -EINVAL);
|
||||
assert_return(ret, -EINVAL);
|
||||
|
||||
if (!j->fields_file) {
|
||||
if (j->fields_file_lost)
|
||||
@@ -3549,7 +3549,7 @@ _public_ int sd_journal_enumerate_fields(sd_journal *j, const char **field) {
|
||||
/* Proceed with next file */
|
||||
j->fields_file = ordered_hashmap_next(j->files, f->path);
|
||||
if (!j->fields_file) {
|
||||
*field = NULL;
|
||||
*ret = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3629,7 +3629,7 @@ _public_ int sd_journal_enumerate_fields(sd_journal *j, const char **field) {
|
||||
if (!field_is_valid(j->fields_buffer))
|
||||
return -EBADMSG;
|
||||
|
||||
*field = j->fields_buffer;
|
||||
*ret = j->fields_buffer;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,30 +55,28 @@ static bool rtnl_message_type_is_nsid(uint16_t type) {
|
||||
}
|
||||
|
||||
#define DEFINE_RTNL_MESSAGE_SETTER(class, header_type, element, name, value_type) \
|
||||
/* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \
|
||||
int sd_rtnl_message_##class##_set_##name(sd_netlink_message *m, value_type value) { \
|
||||
int sd_rtnl_message_##class##_set_##name(sd_netlink_message *m, value_type name) { \
|
||||
assert_return(m, -EINVAL); \
|
||||
assert_return(m->hdr, -EINVAL); \
|
||||
assert_return(rtnl_message_type_is_##class(m->hdr->nlmsg_type), -EINVAL); \
|
||||
\
|
||||
header_type *hdr = NLMSG_DATA(m->hdr); \
|
||||
hdr->element = value; \
|
||||
hdr->element = name; \
|
||||
return 0; \
|
||||
}
|
||||
|
||||
#define DEFINE_RTNL_MESSAGE_PREFIXLEN_SETTER(class, header_type, family_element, element, name, value_type) \
|
||||
/* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \
|
||||
int sd_rtnl_message_##class##_set_##name(sd_netlink_message *m, value_type value) { \
|
||||
int sd_rtnl_message_##class##_set_##name(sd_netlink_message *m, value_type name) { \
|
||||
assert_return(m, -EINVAL); \
|
||||
assert_return(m->hdr, -EINVAL); \
|
||||
assert_return(rtnl_message_type_is_##class(m->hdr->nlmsg_type), -EINVAL); \
|
||||
\
|
||||
header_type *hdr = NLMSG_DATA(m->hdr); \
|
||||
\
|
||||
if (value > FAMILY_ADDRESS_SIZE_SAFE(hdr->family_element) * 8) \
|
||||
if (name > FAMILY_ADDRESS_SIZE_SAFE(hdr->family_element) * 8) \
|
||||
return -ERANGE; \
|
||||
\
|
||||
hdr->element = value; \
|
||||
hdr->element = name; \
|
||||
return 0; \
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -18,7 +18,7 @@ extern "C" {
|
||||
* allows custom logging
|
||||
*/
|
||||
struct udev;
|
||||
struct udev* udev_ref(struct udev *udev);
|
||||
struct udev* udev_ref(struct udev *p);
|
||||
struct udev* udev_unref(struct udev *udev);
|
||||
struct udev* udev_new(void);
|
||||
void udev_set_log_fn(
|
||||
@@ -63,8 +63,8 @@ const char* udev_list_entry_get_value(struct udev_list_entry *list_entry);
|
||||
* access to sysfs/kernel devices
|
||||
*/
|
||||
struct udev_device;
|
||||
struct udev_device* udev_device_ref(struct udev_device *udev_device);
|
||||
struct udev_device* udev_device_unref(struct udev_device *udev_device);
|
||||
struct udev_device* udev_device_ref(struct udev_device *p);
|
||||
struct udev_device* udev_device_unref(struct udev_device *p);
|
||||
struct udev* udev_device_get_udev(struct udev_device *udev_device);
|
||||
struct udev_device* udev_device_new_from_syspath(struct udev *udev, const char *syspath);
|
||||
struct udev_device* udev_device_new_from_devnum(struct udev *udev, char type, dev_t devnum);
|
||||
@@ -108,8 +108,8 @@ int udev_device_has_current_tag(struct udev_device *udev_device, const char *tag
|
||||
* access to kernel uevents and udev events
|
||||
*/
|
||||
struct udev_monitor;
|
||||
struct udev_monitor* udev_monitor_ref(struct udev_monitor *udev_monitor);
|
||||
struct udev_monitor* udev_monitor_unref(struct udev_monitor *udev_monitor);
|
||||
struct udev_monitor* udev_monitor_ref(struct udev_monitor *p);
|
||||
struct udev_monitor* udev_monitor_unref(struct udev_monitor *p);
|
||||
struct udev* udev_monitor_get_udev(struct udev_monitor *udev_monitor);
|
||||
/* kernel and udev generated events over netlink */
|
||||
struct udev_monitor* udev_monitor_new_from_netlink(struct udev *udev, const char *name);
|
||||
@@ -133,8 +133,8 @@ int udev_monitor_filter_remove(struct udev_monitor *udev_monitor);
|
||||
* search sysfs for specific devices and provide a sorted list
|
||||
*/
|
||||
struct udev_enumerate;
|
||||
struct udev_enumerate* udev_enumerate_ref(struct udev_enumerate *udev_enumerate);
|
||||
struct udev_enumerate* udev_enumerate_unref(struct udev_enumerate *udev_enumerate);
|
||||
struct udev_enumerate* udev_enumerate_ref(struct udev_enumerate *p);
|
||||
struct udev_enumerate* udev_enumerate_unref(struct udev_enumerate *p);
|
||||
struct udev* udev_enumerate_get_udev(struct udev_enumerate *udev_enumerate);
|
||||
struct udev_enumerate* udev_enumerate_new(struct udev *udev);
|
||||
/* device properties filter */
|
||||
@@ -160,8 +160,8 @@ struct udev_list_entry* udev_enumerate_get_list_entry(struct udev_enumerate *ude
|
||||
* access to the currently running udev events
|
||||
*/
|
||||
struct udev_queue;
|
||||
struct udev_queue* udev_queue_ref(struct udev_queue *udev_queue);
|
||||
struct udev_queue* udev_queue_unref(struct udev_queue *udev_queue);
|
||||
struct udev_queue* udev_queue_ref(struct udev_queue *p);
|
||||
struct udev_queue* udev_queue_unref(struct udev_queue *p);
|
||||
struct udev* udev_queue_get_udev(struct udev_queue *udev_queue);
|
||||
struct udev_queue* udev_queue_new(struct udev *udev);
|
||||
unsigned long long int udev_queue_get_kernel_seqnum(struct udev_queue *udev_queue) __attribute__((__deprecated__));
|
||||
@@ -184,8 +184,8 @@ struct udev_list_entry* udev_queue_get_queued_list_entry(struct udev_queue *udev
|
||||
*/
|
||||
struct udev_hwdb;
|
||||
struct udev_hwdb* udev_hwdb_new(struct udev *udev);
|
||||
struct udev_hwdb* udev_hwdb_ref(struct udev_hwdb *hwdb);
|
||||
struct udev_hwdb* udev_hwdb_unref(struct udev_hwdb *hwdb);
|
||||
struct udev_hwdb* udev_hwdb_ref(struct udev_hwdb *p);
|
||||
struct udev_hwdb* udev_hwdb_unref(struct udev_hwdb *p);
|
||||
struct udev_list_entry* udev_hwdb_get_properties_list_entry(struct udev_hwdb *hwdb, const char *modalias, unsigned flags);
|
||||
|
||||
/*
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "copy.h"
|
||||
#include "env-file.h"
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
@@ -19,13 +18,17 @@
|
||||
#include "localed-util.h"
|
||||
#include "log.h"
|
||||
#include "mkdir-label.h"
|
||||
#include "process-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "xkbcommon-util.h"
|
||||
|
||||
#if HAVE_LOCALEGEN
|
||||
#include "copy.h"
|
||||
#include "process-util.h"
|
||||
#endif
|
||||
|
||||
int x11_context_verify_and_warn(const X11Context *xc, int log_level, sd_bus_error *error) {
|
||||
int r;
|
||||
|
||||
|
||||
@@ -45,11 +45,11 @@ typedef struct JournalImporter {
|
||||
#define JOURNAL_IMPORTER_INIT(_fd) { .fd = (_fd), .iovw = {} }
|
||||
#define JOURNAL_IMPORTER_MAKE(_fd) (JournalImporter) JOURNAL_IMPORTER_INIT(_fd)
|
||||
|
||||
void journal_importer_cleanup(JournalImporter *);
|
||||
int journal_importer_process_data(JournalImporter *);
|
||||
int journal_importer_push_data(JournalImporter *, const char *data, size_t size);
|
||||
void journal_importer_drop_iovw(JournalImporter *);
|
||||
bool journal_importer_eof(const JournalImporter *);
|
||||
void journal_importer_cleanup(JournalImporter *imp);
|
||||
int journal_importer_process_data(JournalImporter *imp);
|
||||
int journal_importer_push_data(JournalImporter *imp, const char *data, size_t size);
|
||||
void journal_importer_drop_iovw(JournalImporter *imp);
|
||||
bool journal_importer_eof(const JournalImporter *imp);
|
||||
|
||||
static inline size_t journal_importer_bytes_remaining(const JournalImporter *imp) {
|
||||
return imp->filled;
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
#include "systemctl.h"
|
||||
|
||||
int daemon_reload(enum action, bool graceful);
|
||||
int daemon_reload(enum action action, bool graceful);
|
||||
|
||||
int verb_daemon_reload(int argc, char *argv[], void *userdata);
|
||||
|
||||
@@ -104,9 +104,9 @@ int sd_journal_get_seqnum(sd_journal *j, uint64_t *ret_seqnum, sd_id128_t *ret_s
|
||||
int sd_journal_set_data_threshold(sd_journal *j, size_t sz);
|
||||
int sd_journal_get_data_threshold(sd_journal *j, size_t *sz);
|
||||
|
||||
int sd_journal_get_data(sd_journal *j, const char *field, const void **data, size_t *length);
|
||||
int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t *length);
|
||||
int sd_journal_enumerate_available_data(sd_journal *j, const void **data, size_t *length);
|
||||
int sd_journal_get_data(sd_journal *j, const char *field, const void **ret_data, size_t *ret_size);
|
||||
int sd_journal_enumerate_data(sd_journal *j, const void **ret_data, size_t *ret_size);
|
||||
int sd_journal_enumerate_available_data(sd_journal *j, const void **ret_data, size_t *ret_size);
|
||||
void sd_journal_restart_data(sd_journal *j);
|
||||
|
||||
int sd_journal_add_match(sd_journal *j, const void *data, size_t size);
|
||||
@@ -120,20 +120,20 @@ int sd_journal_seek_monotonic_usec(sd_journal *j, sd_id128_t boot_id, uint64_t u
|
||||
int sd_journal_seek_realtime_usec(sd_journal *j, uint64_t usec);
|
||||
int sd_journal_seek_cursor(sd_journal *j, const char *cursor);
|
||||
|
||||
int sd_journal_get_cursor(sd_journal *j, char **ret_cursor);
|
||||
int sd_journal_get_cursor(sd_journal *j, char **ret);
|
||||
int sd_journal_test_cursor(sd_journal *j, const char *cursor);
|
||||
|
||||
int sd_journal_get_cutoff_realtime_usec(sd_journal *j, uint64_t *from, uint64_t *to);
|
||||
int sd_journal_get_cutoff_monotonic_usec(sd_journal *j, const sd_id128_t boot_id, uint64_t *from, uint64_t *to);
|
||||
int sd_journal_get_cutoff_monotonic_usec(sd_journal *j, sd_id128_t boot_id, uint64_t *from, uint64_t *to);
|
||||
|
||||
int sd_journal_get_usage(sd_journal *j, uint64_t *ret_bytes);
|
||||
|
||||
int sd_journal_query_unique(sd_journal *j, const char *field);
|
||||
int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_t *length);
|
||||
int sd_journal_enumerate_available_unique(sd_journal *j, const void **data, size_t *length);
|
||||
int sd_journal_enumerate_unique(sd_journal *j, const void **ret_data, size_t *ret_size);
|
||||
int sd_journal_enumerate_available_unique(sd_journal *j, const void **ret_data, size_t *ret_size);
|
||||
void sd_journal_restart_unique(sd_journal *j);
|
||||
|
||||
int sd_journal_enumerate_fields(sd_journal *j, const char **field);
|
||||
int sd_journal_enumerate_fields(sd_journal *j, const char **ret);
|
||||
void sd_journal_restart_fields(sd_journal *j);
|
||||
|
||||
int sd_journal_get_fd(sd_journal *j);
|
||||
|
||||
@@ -335,7 +335,7 @@ int sd_json_variant_strv(sd_json_variant *v, char ***ret);
|
||||
int sd_json_variant_unbase64(sd_json_variant *v, void **ret, size_t *ret_size);
|
||||
int sd_json_variant_unhex(sd_json_variant *v, void **ret, size_t *ret_size);
|
||||
|
||||
const char* sd_json_variant_type_to_string(sd_json_variant_type_t t);
|
||||
const char* sd_json_variant_type_to_string(sd_json_variant_type_t i);
|
||||
sd_json_variant_type_t sd_json_variant_type_from_string(const char *s);
|
||||
|
||||
static __inline__ int sd_json_format_enabled(sd_json_format_flags_t flags) {
|
||||
|
||||
Reference in New Issue
Block a user