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
+1 -4
View File
@@ -458,10 +458,7 @@ int main(int argc, char *argv[]) {
ps = ps->next_ps;
ps->schedstat = safe_close(ps->schedstat);
ps->sched = safe_close(ps->sched);
if (ps->smaps) {
fclose(ps->smaps);
ps->smaps = NULL;
}
ps->smaps = safe_fclose(ps->smaps);
}
if (!of) {