Compare commits

...

4 Commits

Author SHA1 Message Date
Lennart Poettering df80c98cde
Merge pull request #17549 from yuwata/tiny-fixes
tiny fixes
2020-11-09 16:04:01 +01:00
Yu Watanabe 601844b71d core: reduce scope of variants
Fixes #17543.
2020-11-09 14:40:05 +09:00
Yu Watanabe 291bb0b01c sd-bus: fix possible division by 0
Fixes #17541.
2020-11-09 14:33:19 +09:00
Yu Watanabe 755b35b1aa home: fix copy-and-paste mistake
Fixes #17542.
2020-11-09 14:00:16 +09:00
3 changed files with 8 additions and 6 deletions

View File

@ -5646,9 +5646,7 @@ void unit_dump_config_items(FILE *f) {
NULSTR_FOREACH(i, load_fragment_gperf_nulstr) {
const char *rvalue = "OTHER", *lvalue;
const ConfigPerfItem *p;
size_t prefix_len;
const char *dot;
unsigned j;
assert_se(p = load_fragment_gperf_lookup(i, strlen(i)));
@ -5657,7 +5655,7 @@ void unit_dump_config_items(FILE *f) {
p->ltype == DISABLED_LEGACY)
continue;
for (j = 0; j < ELEMENTSOF(table); j++)
for (size_t j = 0; j < ELEMENTSOF(table); j++)
if (p->parse == table[j].callback) {
rvalue = table[j].rvalue;
break;
@ -5665,15 +5663,17 @@ void unit_dump_config_items(FILE *f) {
dot = strchr(i, '.');
lvalue = dot ? dot + 1 : i;
prefix_len = dot-i;
if (dot)
if (dot) {
size_t prefix_len = dot - i;
if (!prev || !strneq(prev, i, prefix_len+1)) {
if (prev)
fputc('\n', f);
fprintf(f, "[%.*s]\n", (int) prefix_len, i);
}
}
fprintf(f, "%s=%s\n", lvalue, rvalue);
prev = i;

View File

@ -159,7 +159,7 @@ static int on_home_inotify(sd_event_source *s, const struct inotify_event *event
(void) bus_manager_emit_auto_login_changed(m);
}
if ((event->mask & (IN_DELETE|IN_MOVED_FROM|IN_DELETE)) != 0) {
if ((event->mask & (IN_DELETE | IN_CLOSE_WRITE | IN_MOVED_FROM)) != 0) {
Home *h;
if (FLAGS_SET(event->mask, IN_DELETE))

View File

@ -3189,6 +3189,8 @@ static int container_next_item(sd_bus_message *m, struct bus_container *c, size_
int sz;
sz = bus_gvariant_get_size(c->signature);
if (sz == 0)
return -EBADMSG;
if (sz < 0) {
int alignment;