Mercurial > hg > toybox
view toys/other/freeramdisk.c @ 1310:7baa19cdce59 draft
Remove debug detritus I didn't mean to to check in, and treat an "this variable can never actually be used uninitialized but gcc's warning generator can't tell and fails spamwards" warning.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 24 May 2014 12:51:53 -0500 |
parents | bd4e3608ad04 |
children |
line wrap: on
line source
/* freeramdisk.c - Free all memory allocated to ramdisk * * Copyright 2014 Vivek Kumar Bhagat <vivek.bhagat89@gmail.com> * * No Standard USE_FREERAMDISK(NEWTOY(freeramdisk, "<1>1", TOYFLAG_SBIN|TOYFLAG_NEEDROOT)) config FREERAMDISK bool "freeramdisk" default y help usage: freeramdisk [RAM device] Free all memory allocated to specified ramdisk */ #include "toys.h" 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); }