> hi there,
> i am trying to trick /etc/hotplug/attach into mounting
> the sd card from my android smartphone.
> the principal problem seems to be that at the time
> of e.g. sd2 showing up, the disklabel is not ready yet.
> (maybe the delay is the time android needs to unmount it)
> as no disklabel is ready, 'label:' is also empty and nothing
> so i set out to try make a small sleep loop until
> disklabel can return the label instead of
> "ioctl DIOCGDINFO: Input/output error"
> but it seems like disklabel does not really differentiate
> between failures.
> $ sudo disklabel sd2
> disklabel: ioctl DIOCGDINFO: Input/output error
> tyin:~$ echo $?
> $ sudo disklabel sd3
> disklabel: /dev/rsd3c: Device not configured
> $ echo $?
> also, i could not find the return codes in the disklabel
> man page. is there a way to differentiate between the
> error situations? i dont want to loop forever...