1
0
mirror of https://github.com/systemd/systemd synced 2025-09-30 17:24:46 +02:00

Compare commits

..

No commits in common. "1c3c43a4170efdc3ded2a9c469ad7d2a9df1746c" and "aaf73b2ecf44cf447afe848e36640a003699ceb7" have entirely different histories.

6 changed files with 27 additions and 25 deletions

View File

@ -98,6 +98,7 @@ static int add_locales_from_archive(Set *locales) {
_cleanup_close_ int fd = -1;
size_t sz = 0;
struct stat st;
size_t i;
int r;
fd = open("/usr/lib/locale/locale-archive", O_RDONLY|O_NOCTTY|O_CLOEXEC);
@ -128,7 +129,7 @@ static int add_locales_from_archive(Set *locales) {
}
e = (const struct namehashent*) ((const uint8_t*) p + h->namehash_offset);
for (size_t i = 0; i < h->namehash_size; i++) {
for (i = 0; i < h->namehash_size; i++) {
char *z;
if (e[i].locrec_offset == 0)
@ -433,10 +434,12 @@ const char *special_glyph(SpecialGlyph code) {
}
void locale_variables_free(char *l[_VARIABLE_LC_MAX]) {
LocaleVariable i;
if (!l)
return;
for (LocaleVariable i = 0; i < _VARIABLE_LC_MAX; i++)
for (i = 0; i < _VARIABLE_LC_MAX; i++)
l[i] = mfree(l[i]);
}

View File

@ -172,7 +172,7 @@ static int process_progress(int fd, FILE* console) {
}
for (;;) {
int pass;
int pass, m;
unsigned long cur, max;
_cleanup_free_ char *device = NULL;
double p;
@ -206,17 +206,18 @@ static int process_progress(int fd, FILE* console) {
last = t;
p = percent(pass, cur, max);
r = fprintf(console, "\r%s: fsck %3.1f%% complete...\r", device, p);
if (r < 0)
return -EIO; /* No point in continuing if something happend to our output stream */
fprintf(console, "\r%s: fsck %3.1f%% complete...\r%n", device, p, &m);
fflush(console);
clear = MAX(clear, r);
if (m > clear)
clear = m;
}
if (clear > 0) {
unsigned j;
fputc('\r', console);
for (int j = 0; j < clear; j++)
for (j = 0; j < (unsigned) clear; j++)
fputc(' ', console);
fputc('\r', console);
fflush(console);

View File

@ -518,7 +518,7 @@ static int luks_validate(
blkid_loff_t offset = 0, size = 0;
blkid_partlist pl;
bool found = false;
int r, n;
int r, i, n;
assert(fd >= 0);
assert(label);
@ -570,9 +570,9 @@ static int luks_validate(
if (n < 0)
return errno > 0 ? -errno : -EIO;
for (int i = 0; i < n; i++) {
for (i = 0; i < n; i++) {
blkid_partition pp;
sd_id128_t id = SD_ID128_NULL;
sd_id128_t id;
const char *sid;
errno = 0;
@ -681,12 +681,12 @@ static int luks_validate_home_record(
PasswordCache *cache,
UserRecord **ret_luks_home_record) {
int r;
int r, token;
assert(cd);
assert(h);
for (int token = 0;; token++) {
for (token = 0;; token++) {
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL, *rr = NULL;
_cleanup_(EVP_CIPHER_CTX_freep) EVP_CIPHER_CTX *context = NULL;
_cleanup_(user_record_unrefp) UserRecord *lhr = NULL;
@ -2423,7 +2423,7 @@ static int prepare_resize_partition(
_cleanup_(fdisk_unref_contextp) struct fdisk_context *c = NULL;
_cleanup_(fdisk_unref_tablep) struct fdisk_table *t = NULL;
_cleanup_free_ char *path = NULL, *disk_uuid_as_string = NULL;
size_t n_partitions;
size_t n_partitions, i;
sd_id128_t disk_uuid;
bool found = false;
int r;
@ -2473,7 +2473,7 @@ static int prepare_resize_partition(
return log_error_errno(r, "Failed to acquire partition table: %m");
n_partitions = fdisk_table_get_nents(t);
for (size_t i = 0; i < n_partitions; i++) {
for (i = 0; i < n_partitions; i++) {
struct fdisk_partition *p;
p = fdisk_table_get_partition(t, i);
@ -2898,7 +2898,7 @@ int home_passwd_luks(
PasswordCache *cache, /* the passwords acquired via PKCS#11/FIDO2 security tokens */
char **effective_passwords /* new passwords */) {
size_t volume_key_size, max_key_slots, n_effective;
size_t volume_key_size, i, max_key_slots, n_effective;
_cleanup_(erase_and_freep) void *volume_key = NULL;
struct crypt_pbkdf_type good_pbkdf, minimal_pbkdf;
const char *type;
@ -2943,7 +2943,7 @@ int home_passwd_luks(
build_good_pbkdf(&good_pbkdf, h);
build_minimal_pbkdf(&minimal_pbkdf, h);
for (size_t i = 0; i < max_key_slots; i++) {
for (i = 0; i < max_key_slots; i++) {
r = crypt_keyslot_destroy(setup->crypt_device, i);
if (r < 0 && !IN_SET(r, -ENOENT, -EINVAL)) /* Returns EINVAL or ENOENT if there's no key in this slot already */
return log_error_errno(r, "Failed to destroy LUKS password: %m");

View File

@ -664,11 +664,10 @@ int compress_stream_lz4(int fdf, int fdt, uint64_t max_bytes) {
offset += n;
total_out += n;
if (max_bytes != (uint64_t) -1 && total_out > (size_t) max_bytes) {
r = log_debug_errno(SYNTHETIC_ERRNO(EFBIG),
"Compressed stream longer than %" PRIu64 " bytes", max_bytes);
goto cleanup;
}
if (max_bytes != (uint64_t) -1 && total_out > (size_t) max_bytes)
return log_debug_errno(SYNTHETIC_ERRNO(EFBIG),
"Compressed stream longer than %" PRIu64 " bytes",
max_bytes);
if (size - offset < frame_size + 4) {
k = loop_write(fdt, buf, offset, false);

View File

@ -652,7 +652,7 @@ int generator_write_veritysetup_service_section(
const char *roothash,
const char *options) {
_cleanup_free_ char *name_escaped = NULL, *data_what_escaped = NULL, *hash_what_escaped = NULL,
_cleanup_free_ char *name_escaped = NULL, *data_what_escaped = NULL, *hash_what_escaped,
*roothash_escaped = NULL, *options_escaped = NULL;
assert(f);

View File

@ -1773,7 +1773,6 @@ static int udev_rule_apply_token_to_event(
}
case TK_M_IMPORT_BUILTIN: {
UdevBuiltinCommand cmd = PTR_TO_UDEV_BUILTIN_CMD(token->data);
assert(cmd >= 0 && cmd < _UDEV_BUILTIN_MAX);
unsigned mask = 1U << (int) cmd;
if (udev_builtin_run_once(cmd)) {