summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-09-09 15:45:03 +0200
committerDaniel Mack <github@zonque.org>2015-09-09 15:45:03 +0200
commit01da201420edfb2a57e384f109def05f25429305 (patch)
tree1c3090f3b5200ba62613285553afa0f7a6d30b9a /src/shared
parent37b76fd3ee5a03d76786e7bd1e0f8596e6ce47d6 (diff)
parent74ca738f6a01fb5fc19c5c3899f5cb1fdc1d7f68 (diff)
Merge pull request #1218 from poettering/safe-fclose
util: introduce safe_fclose() and port everything over to it
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/pager.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/shared/pager.c b/src/shared/pager.c
index 55fd5cb79e..479a9d5e8d 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -151,13 +151,10 @@ void pager_close(void) {
return;
/* Inform pager that we are done */
- fclose(stdout);
- stdout = NULL;
+ stdout = safe_fclose(stdout);
+ stderr = safe_fclose(stderr);
- fclose(stderr);
- stderr = NULL;
-
- kill(pager_pid, SIGCONT);
+ (void) kill(pager_pid, SIGCONT);
(void) wait_for_terminate(pager_pid, NULL);
pager_pid = 0;
}