Philip Van Hoof <[EMAIL PROTECTED]> writes:

[...]

> int we_have_been_executed_by_a_tty=0;
> 
> if (!isatty(fileno(stdout))) { /* not sure if correct */

fileno(stdout) is always 1.

>       we_have_been_executed_by_a_tty=1;
> }
> 
> if (we_have_been_executed_by_a_tty) {
> 
>       printf("We had to mount some media to complete the installation of
>               some packages, do you want to unmount this media
>               (release it) ? [Y/n]");
> 
> } else {
> /*    Probably some GUI tool executed us. Let the tool handle the
>       unmounting of devices
> */
> }

-- 
Guillaume Cottenceau - http://people.mandrakesoft.com/~gc/

Reply via email to