[Top][All Lists]

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

Re: bug#11150: getlogin test failure

From: Pádraig Brady
Subject: Re: bug#11150: getlogin test failure
Date: Fri, 09 Nov 2012 15:01:32 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

On 08/13/2012 03:02 PM, Jim Meyering wrote:
Andrew Warshall wrote:
    I'm seeing the same issue with 8.18. Apparently xterm doesn't write
    to /var/run/utmp by default, so getlogin () fails with errno ==
    ENOENT. However, isatty (0) still succeeds. The attached patch
    (based on, though not interchangeable with, the sed command at
    skips the test under those conditions (at least it works on my
    machine). Of course, you could alternatively take the position that
    reliance on /var/run/utmp is a bug in getlogin () in gnulib; but
    then I don't know how to fix it.

Thanks for the report and patch.
I'm forwarding this to the bug-gnulib list
since that is where this test is maintained.

--- gnulib-tests/test-getlogin.c.orig   2012-08-12 10:38:28.000000000 -0400
+++ gnulib-tests/test-getlogin.c        2012-08-12 10:39:06.000000000 -0400
@@ -42,9 +42,10 @@
        /* getlogin() fails when stdin is not connected to a tty.  */
        ASSERT (errno == ENOTTY
                || errno == EINVAL /* seen on Linux/SPARC */
+             || errno == ENOENT
  #if !defined __hpux /* On HP-UX 11.11 it fails anyway.  */
-      ASSERT (! isatty (0));
+      ASSERT (errno == ENOENT || ! isatty (0));
        fprintf (stderr, "Skipping test: stdin is not a tty.\n");
        return 77;

Fixed with:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]