[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#334974: kdeinit: bogus "couldn't open tty" error



Package: kdelibs-bin
Severity: normal
Tags: patch

While debugging an unrelated problem, I found this:

  kdeinit: couldn't open() tty: Permission denied

This error message is not very useful.  If it told you which terminal is that
which can't be opened, then it'd actualy help debugging the problem.  (of
course, I can use ktrace, but that's beside the point).

Patch attached.

-- System Information:
Debian Release: testing/unstable
Architecture: kfreebsd-i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: GNU/kFreeBSD 5.4-1-686
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
  kdeinit: couldn't open() tty: Permission denied

diff -ur kdelibs-3.4.2.old/kinit/kinit.cpp kdelibs-3.4.2/kinit/kinit.cpp
--- kdelibs-3.4.2.old/kinit/kinit.cpp	2005-07-20 11:19:21.000000000 +0200
+++ kdelibs-3.4.2/kinit/kinit.cpp	2005-10-21 10:19:45.000000000 +0200
@@ -255,7 +255,7 @@
     int fd = open( tty, O_WRONLY );
     if( fd < 0 )
     {
-        perror( "kdeinit: couldn't open() tty" );
+        fprintf( "kdeinit: couldn't open() %s: %s\n", tty, strerror (errno) );
         return;
     }
     if( dup2( fd, STDOUT_FILENO ) < 0 )

Reply to: