Help! "pg: cannot reopen stdout"

Steve Dempsey steved at longs.LANCE.ColoState.Edu
Sun Jan 22 12:43:06 AEST 1989


In article <449 at fciva.FRANKLIN.COM> fciva!dag at uunet.uu.net	 (Daniel A. Graifer) writes:
>Somebody please help.
> [...]
>I wanted to do a chmod 622 /dev/tty1*, but I did chmod 622 /dev/tty*.
                                                                   -^-
>I realized my mistake, did an ls -l on our old system, and chmod'd everything
>back to the way it is on the old system.
>
>Everything seemed fine until I got on a terminal in my personal account and
>tried to look at file with pg (actually, /usr/bin/pg). I got:
>
>pg: unable to reopen stdout
>
>Anybody got any ideas?

Interactive things like pg often use /dev/tty as stdout.  I was once
frustrated for days by code that behaved like this.  It turns out that
the it explicitly opened /dev/tty, but reported the error cryptically
as `can't open stdout' or some such.  Anyway, the fix was to chmod 666
/dev/tty.  I suspect that one was overlooked in the repair attempt.

>Daniel A. Graifer
>uunet!fciva!dag

        Steve Dempsey,  Center for Computer Assisted Engineering
  Colorado State University, Fort Collins, CO  80523    +1 303 491 0630
INET: steved at longs.LANCE.ColoState.Edu, dempsey at handel.CS.ColoState.Edu
UUCP: boulder!ccncsu!longs.LANCE.ColoState.Edu!steved, ...!ncar!handel!dempsey



More information about the Comp.unix.wizards mailing list