I have been trying use zenity with standard re-direction in a shell script, something like
for i in $(seq 1 10); do echo $i; done | zenity --list --column ="Number"
But on the command line this works , but throws the following warning:
(zenity:3328): GLib-WARNING **: Invalid file descriptor.
This seems to happen only when data is redirected to the Zenity command through a pipe.
Could anyone please tell me what this warning signifies?
This error is triggered by attempting to close stdin twice - once after all the data has been read from the sequence, and then secondly as it's just about to quit - this is in the zenity source. It's purely cosmetic and can be safely ignored - the zenity code is doing nothing else except quitting at that point.
In the handler
zenity_tree_handle_stdin
, towards the end of the routine it closes the same channel (there is variable hiding caused by using the same named variable in the function and at the global scope):In
tree.c
~line 648 as the program is about to exit:Both of these code paths will attempt to close the same channel, causing the warning. Because the next thing done after line 648 is to issue a
gtk_main_quit
, then I think the warning can be safely ignored.