aboutsummaryrefslogtreecommitdiff
path: root/util-linux/fdflush.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/fdflush.c')
-rw-r--r--util-linux/fdflush.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c
index a4245c7e3..0756ddfbf 100644
--- a/util-linux/fdflush.c
+++ b/util-linux/fdflush.c
@@ -32,16 +32,23 @@
32 32
33extern int fdflush_main(int argc, char **argv) 33extern int fdflush_main(int argc, char **argv)
34{ 34{
35 int fd; 35 int fd, result;
36 36
37 if (argc <= 1) 37 if (argc <= 1)
38 show_usage(); 38 show_usage();
39 if ((fd = open(*(++argv), 0)) < 0) 39 if ((fd = open(*(++argv), 0)) < 0)
40 goto die_the_death; 40 goto die_the_death;
41 41
42 if (ioctl(fd, FDFLUSH, 0)) 42 result = ioctl(fd, FDFLUSH, 0);
43#ifdef CONFIG_FEATURE_CLEAN_UP
44 close(fd);
45#endif
46 if (result) {
43 goto die_the_death; 47 goto die_the_death;
48 }
44 49
50 /* Don't bother closing. Exit does
51 * that, so we can save a few bytes */
45 return EXIT_SUCCESS; 52 return EXIT_SUCCESS;
46 53
47die_the_death: 54die_the_death: