Reword manpage to be more general (you do not only eject CD-ROM-drives,
but BluRay-drives, floppy drives, LaserDisk-readers, toaster, whatever).
Allow to specify multiple devices in the command line. Doesn't add
LOC (the few more lines added are due to stricter error-checking)
and might become handy for somebody in the future while not
breaking scripts that assume only one argument.
Crying like GNU coreutils when more than one device is given is
not suckless:
$ eject /dev/sr0 /dev/sr1
eject: too many arguments
- helper support (mount.type).
- helpers need to be in $PATH, if needed we can add a check for
/sbin/mount.XXXX
- pass -B, -M, -R to helper, its more reliable to pass these named
options with -o however.
- allow prefix "no" for which type no action should be taken:
mount -a -t nonfs,ext4
fix bugs:
- dont modify me->mnt_opts (used strtok).
rule to make ubase-box and setup symlinks for $BIN
some (maybe) interesting info:
$ make LDFLAGS="-s -static" CFLAGS="-Os" PREFIX=/ DESTDIR=`pwd`/static-normal install
$ make LDFLAGS="-s -static" CFLAGS="-Os" PREFIX=/ DESTDIR=`pwd`/static-box ubase-box-install
$ du -sk static-normal/ static-box
1776 static-normal
356 static-box
- use getmntent_r instead of getmntent: because getmntent was nested it
overwrote the previous internal mntent structure.
- check mounted() first, if not try to mount: this also makes sure filesystems
were not mounted multiple times (like tmpfs) and errno is not overwritten in
mounted(). For this reason also mount() errno EBUSY can't be used (tested).
For the common case where we have pts/ or tty do it straight
away. Otherwise traverse /dev for a match. This fixes ps(1) when
it is executed over a serial terminal with tty names like ttyAMA0.