projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
install-reloc: Support multi-binary installation.
[gnulib.git]
/
tests
/
test-getlogin.c
diff --git
a/tests/test-getlogin.c
b/tests/test-getlogin.c
index
449ceaa
..
54e48e9
100644
(file)
--- a/
tests/test-getlogin.c
+++ b/
tests/test-getlogin.c
@@
-1,5
+1,5
@@
/* Test of getting user name.
/* Test of getting user name.
- Copyright (C) 2010-201
2
Free Software Foundation, Inc.
+ Copyright (C) 2010-201
3
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-39,9
+39,17
@@
main (void)
buf = getlogin ();
if (buf == NULL)
{
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 */
/* getlogin() fails when stdin is not connected to a tty. */
ASSERT (errno == ENOTTY
|| errno == EINVAL /* seen on Linux/SPARC */
+ || errno == ENXIO
);
#if !defined __hpux /* On HP-UX 11.11 it fails anyway. */
ASSERT (! isatty (0));
);
#if !defined __hpux /* On HP-UX 11.11 it fails anyway. */
ASSERT (! isatty (0));