chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
localectl: fix localectl set-x11-keymap syntax description
[elogind.git]
/
src
/
dbus1-generator
/
dbus1-generator.c
diff --git
a/src/dbus1-generator/dbus1-generator.c
b/src/dbus1-generator/dbus1-generator.c
index dcfceecf6356e0ef26b00fa3c93303db7fe3e602..3c4522b5893cde3ee1d5338047b4e78d0831c498 100644
(file)
--- a/
src/dbus1-generator/dbus1-generator.c
+++ b/
src/dbus1-generator/dbus1-generator.c
@@
-40,6
+40,7
@@
static int create_dbus_files(
_cleanup_free_ char *b = NULL, *s = NULL, *lnk = NULL;
_cleanup_fclose_ FILE *f = NULL;
_cleanup_free_ char *b = NULL, *s = NULL, *lnk = NULL;
_cleanup_fclose_ FILE *f = NULL;
+ int r;
assert(path);
assert(name);
assert(path);
assert(name);
@@
-100,12
+101,15
@@
static int create_dbus_files(
}
}
}
}
-
fflush
(f);
- if (
ferror(f)
) {
- log_error("Failed to write %s: %
m", a
);
- return
-errno
;
+
r = fflush_and_check
(f);
+ if (
r < 0
) {
+ log_error("Failed to write %s: %
s", a, strerror(-r)
);
+ return
r
;
}
}
+ fclose(f);
+ f = NULL;
+
service = s;
}
service = s;
}
@@
-134,10
+138,10
@@
static int create_dbus_files(
name,
service);
name,
service);
-
fflush
(f);
- if (
ferror(f)
) {
- log_error("Failed to write %s: %
m", b
);
- return
-errno
;
+
r = fflush_and_check
(f);
+ if (
r < 0
) {
+ log_error("Failed to write %s: %
s", b, strerror(-r)
);
+ return
r
;
}
lnk = strjoin(arg_dest_late, "/" SPECIAL_BUSNAMES_TARGET ".wants/", name, ".busname", NULL);
}
lnk = strjoin(arg_dest_late, "/" SPECIAL_BUSNAMES_TARGET ".wants/", name, ".busname", NULL);
@@
-169,7
+173,7
@@
static int add_dbus(const char *path, const char *fname, const char *type) {
assert(path);
assert(fname);
assert(path);
assert(fname);
- p = strappenda
3
(path, "/", fname);
+ p = strappenda(path, "/", fname);
r = config_parse(NULL, p, NULL,
"D-BUS Service\0",
config_item_table_lookup, table,
r = config_parse(NULL, p, NULL,
"D-BUS Service\0",
config_item_table_lookup, table,