diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-09-09 15:20:10 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-09-09 15:26:11 +0200 |
commit | 74ca738f6a01fb5fc19c5c3899f5cb1fdc1d7f68 (patch) | |
tree | 920d0abca454976756296d982d1cb9ef794e1ade /src/shared/pager.c | |
parent | 9c00a6adfa6c2ded071222b2ec76295480add34e (diff) |
util: introduce safe_fclose() and port everything over to it
Adds a coccinelle script to port things over automatically.
Diffstat (limited to 'src/shared/pager.c')
-rw-r--r-- | src/shared/pager.c | 9 |
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; } |