Probems opening /dev/tty when running from gmenu2x

David Kuehling dvdkhlng at gmx.de
Sat Dec 25 12:43:32 EST 2010


>>>>> "David" == David Kuehling <dvdkhlng at gmx.de> writes:

>>>>> "Xiangfu" == Xiangfu Liu <xiangfu at sharism.cc> writes:

>> when we run 'ash' 'bash' in gmenu2x it's always give me : /bin/ash :
>> can't access tty; job control is turned off when start 'ash' 'bash'
>> (http://en.qi-hardware.com/wiki/OpenWrt_Software_Image#Image_2010-12-14
>> see the * KNOWN ISSUES)

> Ok, after lots of trial and error, I now have a fix that works.  It is
> *ugly*, need to clean it up a bit, but anyways:
[..]

Turns out there is a much more concise fix for the problem:

--8<--
		int pid = setsid();
		tcsetpgrp(1, pid);
		ioctl(1, TIOCSCTTY, (char *)1);
--8<--

A properly formatted and commented patch is attached below (don't have
commit access to gmenu2x).

cheers,

David
-- 
GnuPG public key: http://user.cs.tu-berlin.de/~dvdkhlng/dk.gpg
Fingerprint: B17A DC95 D293 657B 4205  D016 7DEF 5323 C174 7D40

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gmenu2x-fix-tty.patch
Type: text/x-diff
Size: 1128 bytes
Desc: not available
URL: <http://lists.en.qi-hardware.com/pipermail/discussion/attachments/20101225/3db41da8/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.en.qi-hardware.com/pipermail/discussion/attachments/20101225/3db41da8/attachment.pgp>


More information about the discussion mailing list


interactive