util: introduce safe_fclose() and port everything over to it

Adds a coccinelle script to port things over automatically.
This commit is contained in:
Lennart Poettering
2015-09-09 15:26:11 +02:00
parent 9c00a6adfa
commit 74ca738f6a
14 changed files with 79 additions and 49 deletions
+3 -6
View File
@@ -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;
}