projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove redundant AC_SUBST invocation.
[gnulib.git]
/
tests
/
test-getlogin.c
diff --git
a/tests/test-getlogin.c
b/tests/test-getlogin.c
index
6589289
..
1365108
100644
(file)
--- a/
tests/test-getlogin.c
+++ b/
tests/test-getlogin.c
@@
-23,6
+23,7
@@
#include "signature.h"
SIGNATURE_CHECK (getlogin, char *, (void));
#include "signature.h"
SIGNATURE_CHECK (getlogin, char *, (void));
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
@@
-35,7
+36,13
@@
main (void)
/* Test value. */
buf = getlogin ();
/* Test value. */
buf = getlogin ();
- ASSERT (buf != NULL);
+ if (buf == NULL)
+ {
+ /* getlogin() fails when stdin is not connected to a tty. */
+ ASSERT (! isatty (0));
+ fprintf (stderr, "Skipping test: stdin is not a tty.\n");
+ return 77;
+ }
/* Compare against the value from the environment. */
#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
/* Compare against the value from the environment. */
#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)