On Mon, Feb 04, 2013 at 03:13:25PM +0100, Mirco Tischler wrote: > --- > src/journal/coredump.c | 28 ++++++---------------------- > 1 file changed, 6 insertions(+), 22 deletions(-) > > diff --git a/src/journal/coredump.c b/src/journal/coredump.c > index 91528d3..4f79c45 100644 > --- a/src/journal/coredump.c > +++ b/src/journal/coredump.c > @@ -32,6 +32,7 @@ > > #include "log.h" > #include "util.h" > +#include "macro.h" > #include "mkdir.h" > #include "special.h" > #include "cgroup-util.h" > @@ -49,7 +50,7 @@ enum { > }; > > static int divert_coredump(void) { > - FILE *f; > + _cleanup_fclose_ FILE *f = NULL; > int r; > > log_info("Detected coredump of the journal daemon itself, diverting > coredump to /var/lib/systemd/coredump/."); > @@ -94,21 +95,20 @@ static int divert_coredump(void) { > } > > finish: > - fclose(f); > return r; > } > Hi, if you do that, than you can go one step further, and get rid of finish label. We don't enforce a single point of return, and it is easier to read 'return -errno' instead of 'r = -errno; ...; return r;'.
Zbyszek _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel