* tests/test-getlogin.c (main): Skip tests if getlogin fails
with errno == ENOENT. This happened to me on Ubuntu 12.04.1 x86,
when running a test in an Emacs shell buffer.
+2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ getlogin-tests: allow errno == ENOENT
+ * tests/test-getlogin.c (main): Skip tests if getlogin fails
+ with errno == ENOENT. This happened to me on Ubuntu 12.04.1 x86,
+ when running a test in an Emacs shell buffer.
+
2012-11-08 Jim Meyering <jim@meyering.net>
tests/nap.h: avoid warning about unused variable
buf = getlogin ();
if (buf == NULL)
{
+ if (errno == ENOENT)
+ {
+ /* This can happen on GNU/Linux. */
+ fprintf (stderr, "Skipping test: no entry in utmp file.\n");
+ return 77;
+ }
+
/* getlogin() fails when stdin is not connected to a tty. */
ASSERT (errno == ENOTTY
|| errno == EINVAL /* seen on Linux/SPARC */