[PATCH] eject -T support

Tito farmatito at tiscali.it
Sun Oct 8 02:18:15 PDT 2006


On Saturday 7 October 2006 23:14, Denis Vlasenko wrote:
> On Saturday 07 October 2006 19:27, Rob Landley wrote:
> > On Friday 06 October 2006 12:09 pm, Tito wrote:
> > > 1)  something mounted OVER our cdrom:
> > > 
> > > /dev/hdd   on /media/cdrom1 type iso9660 (ro,noexec,nosuid,nodev)
> > > /dev/hdb1 on /media/cdrom1 type reiserfs (rw)
> > > 
> > > ./busybox eject
> > > eject: /dev/cdrom: Input/output error
> > > 
> > > /dev/hdd   on /media/cdrom1 type iso9660 (ro,noexec,nosuid,nodev)
> > > 
> > > the overmounted block device is unmounted and eject fails.
> > 
> > Doctor, it hurts when I poke myself in the eye with a fork!
> > 
> > Pilot error.
> > 
> > > 2)  cdrom is mounted many times:
> > > 
> > > /dev/hdd on /media/cdrom1 type iso9660 (ro)
> > > /dev/hdd on /media/cdrom0 type iso9660 (ro)
> > 
> > Pilot error.
> 
> Yes, but we'd better fail instead of unmounting _something else_!
> That's my proposal: just (try to) eject the thing, don't
> try to do umount job.
> --
> vda

Hi Denis and Rob,
This version of eject seems to get the job done!
Bloat check is:
function                                             old     new   delta
eject_main                                           193     331    +138
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 138/0)             Total: 138 bytes

Maybe we can make this umount stuff a config option (CONFIG_EJECT_UMOUNT or add it to CONFIG_DESKTOP)!?

It is tested with:
1) unmounted devices
2) mounted devices
3) devices mounted multiple times
4) devices overmounted by other block devices.

Hints, improvements, critics are always welcome.
Attached is the whole file as drop in replacement for testing
and review purpose, if you prefer a diff just ask and I will send
one.

Ciao,
Tito
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eject.c.bz2
Type: application/x-bzip2
Size: 1471 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20061008/f35d5059/attachment.bin 


More information about the busybox mailing list