diff options
author | Eric Andersen | 2003-03-07 18:09:06 +0000 |
---|---|---|
committer | Eric Andersen | 2003-03-07 18:09:06 +0000 |
commit | 77831c11d15861039eb8a30706d9b460363c5cc8 (patch) | |
tree | a2bf6e559137827445a09e4eaf9daa4f1aa44ba3 /util-linux/fdflush.c | |
parent | 3719e9e7908ae002ef579b2ce39273f9d7130d40 (diff) | |
download | busybox-77831c11d15861039eb8a30706d9b460363c5cc8.zip busybox-77831c11d15861039eb8a30706d9b460363c5cc8.tar.gz |
be more careful about cleaning up
Diffstat (limited to 'util-linux/fdflush.c')
-rw-r--r-- | util-linux/fdflush.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c index a4245c7..0756ddf 100644 --- a/util-linux/fdflush.c +++ b/util-linux/fdflush.c @@ -32,16 +32,23 @@ extern int fdflush_main(int argc, char **argv) { - int fd; + int fd, result; if (argc <= 1) show_usage(); if ((fd = open(*(++argv), 0)) < 0) goto die_the_death; - if (ioctl(fd, FDFLUSH, 0)) + result = ioctl(fd, FDFLUSH, 0); +#ifdef CONFIG_FEATURE_CLEAN_UP + close(fd); +#endif + if (result) { goto die_the_death; + } + /* Don't bother closing. Exit does + * that, so we can save a few bytes */ return EXIT_SUCCESS; die_the_death: |