aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
Diffstat (limited to 'toys')
-rw-r--r--toys/pending/freeramdisk.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/toys/pending/freeramdisk.c b/toys/pending/freeramdisk.c
index 8ff4e75c..2af2d504 100644
--- a/toys/pending/freeramdisk.c
+++ b/toys/pending/freeramdisk.c
@@ -10,7 +10,7 @@ config FREERAMDISK
bool "freeramdisk"
default n
help
- usage: freeramdisk <RAM device>
+ usage: freeramdisk [RAM device]
Free all memory allocated to specified ramdisk
*/
@@ -19,9 +19,9 @@ config FREERAMDISK
void freeramdisk_main(void)
{
- int fd;
+ int fd;
- fd = xopen(toys.optargs[0], O_RDWR);
- xioctl(fd, BLKFLSBUF, toys.optargs[0]);
- xclose(fd);
+ fd = xopen(toys.optargs[0], O_RDWR);
+ xioctl(fd, BLKFLSBUF, toys.optargs[0]);
+ if (CFG_TOYBOX_FREE) xclose(fd);
}