chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
util: replace close_pipe() with new safe_close_pair()
[elogind.git]
/
src
/
journal
/
journal-remote.c
diff --git
a/src/journal/journal-remote.c
b/src/journal/journal-remote.c
index 6d7ba6caa06e137ee0aae58d16b016702d9a24c5..4ece14ee777b9ce9138cc6bfc0fabf851c2ea827 100644
(file)
--- a/
src/journal/journal-remote.c
+++ b/
src/journal/journal-remote.c
@@
-89,7
+89,7
@@
static int spawn_child(const char* child, char** argv) {
if (child_pid < 0) {
r = -errno;
log_error("Failed to fork: %m");
if (child_pid < 0) {
r = -errno;
log_error("Failed to fork: %m");
-
close_pipe
(fd);
+
safe_close_pair
(fd);
return r;
}
return r;
}
@@
-101,9
+101,7
@@
static int spawn_child(const char* child, char** argv) {
_exit(EXIT_FAILURE);
}
_exit(EXIT_FAILURE);
}
- r = close_pipe(fd);
- if (r < 0)
- log_warning("Failed to close pipe fds: %m");
+ safe_close_pair(fd);
/* Make sure the child goes away when the parent dies */
if (prctl(PR_SET_PDEATHSIG, SIGTERM) < 0)
/* Make sure the child goes away when the parent dies */
if (prctl(PR_SET_PDEATHSIG, SIGTERM) < 0)
@@
-142,7
+140,7
@@
static int spawn_curl(char* url) {
static int spawn_getter(char *getter, char *url) {
int r;
static int spawn_getter(char *getter, char *url) {
int r;
- char _cleanup_strv_free_ **words = NULL
, **words2 = NULL
;
+ char _cleanup_strv_free_ **words = NULL;
assert(getter);
words = strv_split_quoted(getter);
assert(getter);
words = strv_split_quoted(getter);