int btrfs_log_dev_root(int level, int ret, const char *p);
-bool btrfs_might_be_subvol(const struct stat *st);
+bool btrfs_might_be_subvol(const struct stat *st) _pure_;
int btrfs_forget_device(const char *path);
return 0;
}
-int _hashmap_by_section_find_unused_line(
+static int _hashmap_by_section_find_unused_line(
HashmapBase *entries_by_section,
const char *filename,
unsigned *ret) {
int config_section_compare_func(const ConfigSection *x, const ConfigSection *y);
extern const struct hash_ops config_section_hash_ops;
-int _hashmap_by_section_find_unused_line(
- HashmapBase *entries_by_section,
- const char *filename,
- unsigned *ret);
-
int hashmap_by_section_find_unused_line(Hashmap *entries_by_section, const char *filename, unsigned *ret);
int ordered_hashmap_by_section_find_unused_line(OrderedHashmap *entries_by_section, const char *filename, unsigned *ret);
return stop;
}
+/* This is intended to be used with _cleanup_ attribute. */
static inline void notify_on_cleanup(const char **p) {
if (*p)
(void) sd_notify(false, *p);
return m && m->partitions[PARTITION_ESP].found && dissected_image_is_bootable_os(m);
}
-bool dissected_image_is_portable(DissectedImage *m);
-bool dissected_image_is_initrd(DissectedImage *m);
+bool dissected_image_is_portable(DissectedImage *m) _pure_;
+bool dissected_image_is_initrd(DissectedImage *m) _pure_;
DecryptedImage* decrypted_image_ref(DecryptedImage *p);
DecryptedImage* decrypted_image_unref(DecryptedImage *p);
SECCOMP_ERROR_NUMBER_KILL = INT_MAX - 1,
};
-bool seccomp_errno_or_action_is_valid(int n);
-
-int seccomp_parse_errno_or_action(const char *p);
-
-const char* seccomp_errno_or_action_to_string(int num);
+bool seccomp_errno_or_action_is_valid(int n) _const_;
+int seccomp_parse_errno_or_action(const char *p) _pure_;
+const char* seccomp_errno_or_action_to_string(int num) _const_;
return 0;
}
-bool SLEEP_NEEDS_MEM_SLEEP(const SleepConfig *sc, SleepOperation operation) {
+bool sleep_needs_mem_sleep(const SleepConfig *sc, SleepOperation operation) {
assert(sc);
assert(operation >= 0 && operation < _SLEEP_OPERATION_CONFIG_MAX);
return false;
}
- if (SLEEP_NEEDS_MEM_SLEEP(sleep_config, operation)) {
+ if (sleep_needs_mem_sleep(sleep_config, operation)) {
r = sleep_mode_supported("/sys/power/mem_sleep", sleep_config->mem_modes);
if (r < 0)
return r;
int parse_sleep_config(SleepConfig **sleep_config);
-bool SLEEP_NEEDS_MEM_SLEEP(const SleepConfig *sc, SleepOperation operation);
+bool sleep_needs_mem_sleep(const SleepConfig *sc, SleepOperation operation) _pure_;
typedef enum SleepSupport {
SLEEP_SUPPORTED,
return getxattr_at_malloc(fd, path, smack_attr_to_string(attr), /* at_flags = */ 0, ret, /* ret_size= */ NULL);
#else
-return -EOPNOTSUPP;
+ return -EOPNOTSUPP;
#endif
}
return (f >> 21) & _USER_RECORD_MASK_MAX;
}
-sd_json_dispatch_flags_t USER_RECORD_LOAD_FLAGS_TO_JSON_DISPATCH_FLAGS(UserRecordLoadFlags flags);
+sd_json_dispatch_flags_t USER_RECORD_LOAD_FLAGS_TO_JSON_DISPATCH_FLAGS(UserRecordLoadFlags flags) _const_;
typedef struct Pkcs11EncryptedKey {
/* The encrypted passphrase, which can be decrypted with the private key indicated below */
.uid_max = UID_NOBODY - 1, \
}
-bool userdb_match_is_set(const UserDBMatch *match);
+bool userdb_match_is_set(const UserDBMatch *match) _pure_;
void userdb_match_done(UserDBMatch *match);
if (state_fd < 0)
return log_error_errno(errno, "Failed to open /sys/power/state: %m");
- if (SLEEP_NEEDS_MEM_SLEEP(sleep_config, operation)) {
+ if (sleep_needs_mem_sleep(sleep_config, operation)) {
r = write_mode("/sys/power/mem_sleep", sleep_config->mem_modes);
if (r < 0)
return log_error_errno(r, "Failed to write mode to /sys/power/mem_sleep: %m");