[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: coreutils-5.3.0: "make check" fails on NetBSD/sparc-1.5
From: |
Jim Meyering |
Subject: |
Re: coreutils-5.3.0: "make check" fails on NetBSD/sparc-1.5 |
Date: |
Sat, 15 Jan 2005 08:28:55 +0100 |
Adrian Bunk <address@hidden> wrote:
...
> FAIL: tail-tests
[test f-1 failed]
Thanks for the report.
Here's the fix I checked in yesterday:
(I'll update the comment)
2005-01-14 Jim Meyering <address@hidden>
The test, tests/tail/f-1, failed on powerpc-apple-darwin7.7.0.
* src/tail.c (IS_TAILABLE_FILE_TYPE): Adjust definition also to include
sockets, since that's what you get when reading from a command-line-
supplied pipe on Darwin 7.7.
(IS_PIPE_LIKE_FILE_TYPE): Define.
(main): Use new IS_PIPE_LIKE_FILE_TYPE rather than simply S_ISFIFO.
Reported by Nelson Beebe.
Index: src/tail.c
===================================================================
RCS file: /fetish/cu/src/tail.c,v
retrieving revision 1.231
retrieving revision 1.232
diff -u -p -u -r1.231 -r1.232
--- src/tail.c 4 Dec 2004 07:02:35 -0000 1.231
+++ src/tail.c 14 Jan 2005 16:30:15 -0000 1.232
@@ -1,5 +1,5 @@
/* tail -- output the last part of file(s)
- Copyright (C) 1989, 90, 91, 1995-2004 Free Software Foundation, Inc.
+ Copyright (C) 1989, 90, 91, 1995-2005 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
@@ -79,9 +79,14 @@ enum Follow_mode
Follow_descriptor = 2
};
+/* On Darwin 7.7, when reading from a command-line pipe, standard
+ input is of type S_ISSOCK. Everywhere else it's S_ISFIFO. */
+#define IS_PIPE_LIKE_FILE_TYPE(Mode) \
+ (S_ISFIFO (Mode) || S_ISSOCK (Mode))
+
/* The types of files for which tail works. */
#define IS_TAILABLE_FILE_TYPE(Mode) \
- (S_ISREG (Mode) || S_ISFIFO (Mode) || S_ISCHR (Mode))
+ (S_ISREG (Mode) || IS_PIPE_LIKE_FILE_TYPE (Mode) || S_ISCHR (Mode))
static char const *const follow_mode_string[] =
{
@@ -1650,7 +1655,8 @@ main (int argc, char **argv)
if (forever)
{
struct stat stats;
- if (fstat (STDIN_FILENO, &stats) == 0 && S_ISFIFO (stats.st_mode))
+ if (fstat (STDIN_FILENO, &stats) == 0
+ && IS_PIPE_LIKE_FILE_TYPE (stats.st_mode))
forever = false;
}
}