diff options
Diffstat (limited to 'util-linux/freeramdisk.c')
-rw-r--r-- | util-linux/freeramdisk.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c index 55187cb40..6752e49d8 100644 --- a/util-linux/freeramdisk.c +++ b/util-linux/freeramdisk.c | |||
@@ -33,9 +33,9 @@ | |||
33 | //config: ramdisk. If you have no use for freeing memory from a ramdisk, leave | 33 | //config: ramdisk. If you have no use for freeing memory from a ramdisk, leave |
34 | //config: this disabled. | 34 | //config: this disabled. |
35 | 35 | ||
36 | // APPLET_ODDNAME:name main location suid_type help | 36 | // APPLET_ODDNAME:name main location suid_type help |
37 | //applet:IF_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, BB_DIR_BIN, BB_SUID_DROP, fdflush)) | 37 | //applet:IF_FDFLUSH( APPLET_ODDNAME(fdflush, freeramdisk, BB_DIR_BIN, BB_SUID_DROP, fdflush )) |
38 | //applet:IF_FREERAMDISK(APPLET(freeramdisk, BB_DIR_SBIN, BB_SUID_DROP)) | 38 | //applet:IF_FREERAMDISK(APPLET_NOEXEC(freeramdisk, freeramdisk, BB_DIR_SBIN, BB_SUID_DROP, freeramdisk)) |
39 | 39 | ||
40 | //kbuild:lib-$(CONFIG_FDFLUSH) += freeramdisk.o | 40 | //kbuild:lib-$(CONFIG_FDFLUSH) += freeramdisk.o |
41 | //kbuild:lib-$(CONFIG_FREERAMDISK) += freeramdisk.o | 41 | //kbuild:lib-$(CONFIG_FREERAMDISK) += freeramdisk.o |
@@ -67,8 +67,12 @@ int freeramdisk_main(int argc UNUSED_PARAM, char **argv) | |||
67 | fd = xopen(single_argv(argv), O_RDWR); | 67 | fd = xopen(single_argv(argv), O_RDWR); |
68 | 68 | ||
69 | // Act like freeramdisk, fdflush, or both depending on configuration. | 69 | // Act like freeramdisk, fdflush, or both depending on configuration. |
70 | ioctl_or_perror_and_die(fd, (ENABLE_FREERAMDISK && applet_name[1] == 'r') | 70 | ioctl_or_perror_and_die(fd, |
71 | || !ENABLE_FDFLUSH ? BLKFLSBUF : FDFLUSH, NULL, "%s", argv[1]); | 71 | ((ENABLE_FREERAMDISK && applet_name[1] == 'r') || !ENABLE_FDFLUSH) |
72 | ? BLKFLSBUF | ||
73 | : FDFLUSH, | ||
74 | NULL, "%s", argv[1] | ||
75 | ); | ||
72 | 76 | ||
73 | if (ENABLE_FEATURE_CLEAN_UP) close(fd); | 77 | if (ENABLE_FEATURE_CLEAN_UP) close(fd); |
74 | 78 | ||