projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit 'a39d4083cab589d7cd6a13e8a4b8db8875261d75'
[gnulib.git]
/
tests
/
test-getlogin_r.c
diff --git
a/tests/test-getlogin_r.c
b/tests/test-getlogin_r.c
index
043aafb
..
ed103c9
100644
(file)
--- a/
tests/test-getlogin_r.c
+++ b/
tests/test-getlogin_r.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
4
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
@@
-40,9
+40,17
@@
main (void)
err = getlogin_r (buf, sizeof (buf));
if (err != 0)
{
err = getlogin_r (buf, sizeof (buf));
if (err != 0)
{
+ if (errno == ENOENT)
+ {
+ /* This can happen on GNU/Linux. */
+ fprintf (stderr, "Skipping test: no entry in utmp file.\n");
+ return 77;
+ }
+
/* getlogin_r() fails when stdin is not connected to a tty. */
ASSERT (err == ENOTTY
|| errno == EINVAL /* seen on Linux/SPARC */
/* getlogin_r() fails when stdin is not connected to a tty. */
ASSERT (err == 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));