From 2f2c53f15b498e3ecf5cde499c5fdca4a965bd55 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 4 Sep 2021 15:16:24 -0500 Subject: [PATCH] Go ahead and leak the filehandle, the command exits immediately. --- toys/other/freeramdisk.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/toys/other/freeramdisk.c b/toys/other/freeramdisk.c index cb0b7f8f..9e6845a7 100644 --- a/toys/other/freeramdisk.c +++ b/toys/other/freeramdisk.c @@ -19,9 +19,5 @@ config FREERAMDISK void freeramdisk_main(void) { - int fd; - - fd = xopen(toys.optargs[0], O_RDWR); - xioctl(fd, BLKFLSBUF, toys.optargs[0]); - if (CFG_TOYBOX_FREE) xclose(fd); + xioctl(xopen(*toys.optargs, O_RDWR), BLKFLSBUF, 0); } -- 2.39.2