[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grep branch, master, updated. v2.10-31-gca0d4f3
From: |
Paul Eggert |
Subject: |
grep branch, master, updated. v2.10-31-gca0d4f3 |
Date: |
Sun, 01 Jan 2012 01:58:42 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".
The branch, master has been updated
via ca0d4f3bae56c486ec1d49d72c9ed6924236babc (commit)
via 71e02fa1fde638f8ae6d4bd5f985e6d3c2bd65e8 (commit)
from 209bae502a2255aece67625641617335a911f211 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=ca0d4f3bae56c486ec1d49d72c9ed6924236babc
commit ca0d4f3bae56c486ec1d49d72c9ed6924236babc
Author: Paul Eggert <address@hidden>
Date: Sat Dec 31 17:54:59 2011 -0800
grep: do input==output check more like dir loop check
* src/main.c (grepfile): Just use SAME_INODE; don't bother
with SAME_REGULAR_FILE. This works better on properly-working
POSIX hosts, since it handles the case where the file is changing
as we grep it. It works worse on hosts that don't support st_ino
properly, but in practice this isn't that much of a problem here.
* src/system.h (same_file_attributes, SAME_REGULAR_FILE):
Remove; no longer needed.
diff --git a/src/main.c b/src/main.c
index ca6f85f..3fff5b7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1423,8 +1423,8 @@ grepfile (char const *file, struct stats *stats)
input==output, while there is no risk of infloop, there is a race
condition that could result in "alternate" output. */
if (!out_quiet && list_files == 0 && 1 < max_count
- && S_ISREG (stats->stat.st_mode) && out_stat.st_ino
- && SAME_REGULAR_FILE (stats->stat, out_stat))
+ && S_ISREG (out_stat.st_mode) && out_stat.st_ino
+ && SAME_INODE (stats->stat, out_stat))
{
error (0, 0, _("input file %s is also the output"), quote (file));
errseen = 1;
diff --git a/src/system.h b/src/system.h
index db2fea3..f356c08 100644
--- a/src/system.h
+++ b/src/system.h
@@ -51,44 +51,5 @@ enum { EXIT_TROUBLE = 2 };
# define initialize_main(argcp, argvp)
#endif
-/* Do struct stat *S, *T have the same file attributes?
-
- POSIX says that two files are identical if st_ino and st_dev are
- the same, but many file systems incorrectly assign the same (device,
- inode) pair to two distinct files, including:
-
- - GNU/Linux NFS servers that export all local file systems as a
- single NFS file system, if a local device number (st_dev) exceeds
- 255, or if a local inode number (st_ino) exceeds 16777215.
-
- - Network Appliance NFS servers in snapshot directories; see
- Network Appliance bug #195.
-
- - ClearCase MVFS; see bug id ATRia04618.
-
- Check whether two files that purport to be the same have the same
- attributes, to work around instances of this common bug. Do not
- inspect all attributes, only attributes useful in checking for this
- bug.
-
- It's possible for two distinct files on a buggy file system to have
- the same attributes, but it's not worth slowing down all
- implementations (or complicating the configuration) to cater to
- these rare cases in buggy implementations. */
-
-#ifndef same_file_attributes
-# define same_file_attributes(s, t) \
- ((s)->st_mode == (t)->st_mode \
- && (s)->st_nlink == (t)->st_nlink \
- && (s)->st_uid == (t)->st_uid \
- && (s)->st_gid == (t)->st_gid \
- && (s)->st_size == (t)->st_size \
- && (s)->st_mtime == (t)->st_mtime \
- && (s)->st_ctime == (t)->st_ctime)
-#endif
-
-#define SAME_REGULAR_FILE(s, t) \
- (SAME_INODE (s, t) && same_file_attributes (&s, &t))
-
#include "unlocked-io.h"
#endif
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=71e02fa1fde638f8ae6d4bd5f985e6d3c2bd65e8
commit ca0d4f3bae56c486ec1d49d72c9ed6924236babc
Author: Paul Eggert <address@hidden>
Date: Sat Dec 31 17:54:59 2011 -0800
grep: do input==output check more like dir loop check
* src/main.c (grepfile): Just use SAME_INODE; don't bother
with SAME_REGULAR_FILE. This works better on properly-working
POSIX hosts, since it handles the case where the file is changing
as we grep it. It works worse on hosts that don't support st_ino
properly, but in practice this isn't that much of a problem here.
* src/system.h (same_file_attributes, SAME_REGULAR_FILE):
Remove; no longer needed.
diff --git a/src/main.c b/src/main.c
index ca6f85f..3fff5b7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1423,8 +1423,8 @@ grepfile (char const *file, struct stats *stats)
input==output, while there is no risk of infloop, there is a race
condition that could result in "alternate" output. */
if (!out_quiet && list_files == 0 && 1 < max_count
- && S_ISREG (stats->stat.st_mode) && out_stat.st_ino
- && SAME_REGULAR_FILE (stats->stat, out_stat))
+ && S_ISREG (out_stat.st_mode) && out_stat.st_ino
+ && SAME_INODE (stats->stat, out_stat))
{
error (0, 0, _("input file %s is also the output"), quote (file));
errseen = 1;
diff --git a/src/system.h b/src/system.h
index db2fea3..f356c08 100644
--- a/src/system.h
+++ b/src/system.h
@@ -51,44 +51,5 @@ enum { EXIT_TROUBLE = 2 };
# define initialize_main(argcp, argvp)
#endif
-/* Do struct stat *S, *T have the same file attributes?
-
- POSIX says that two files are identical if st_ino and st_dev are
- the same, but many file systems incorrectly assign the same (device,
- inode) pair to two distinct files, including:
-
- - GNU/Linux NFS servers that export all local file systems as a
- single NFS file system, if a local device number (st_dev) exceeds
- 255, or if a local inode number (st_ino) exceeds 16777215.
-
- - Network Appliance NFS servers in snapshot directories; see
- Network Appliance bug #195.
-
- - ClearCase MVFS; see bug id ATRia04618.
-
- Check whether two files that purport to be the same have the same
- attributes, to work around instances of this common bug. Do not
- inspect all attributes, only attributes useful in checking for this
- bug.
-
- It's possible for two distinct files on a buggy file system to have
- the same attributes, but it's not worth slowing down all
- implementations (or complicating the configuration) to cater to
- these rare cases in buggy implementations. */
-
-#ifndef same_file_attributes
-# define same_file_attributes(s, t) \
- ((s)->st_mode == (t)->st_mode \
- && (s)->st_nlink == (t)->st_nlink \
- && (s)->st_uid == (t)->st_uid \
- && (s)->st_gid == (t)->st_gid \
- && (s)->st_size == (t)->st_size \
- && (s)->st_mtime == (t)->st_mtime \
- && (s)->st_ctime == (t)->st_ctime)
-#endif
-
-#define SAME_REGULAR_FILE(s, t) \
- (SAME_INODE (s, t) && same_file_attributes (&s, &t))
-
#include "unlocked-io.h"
#endif
-----------------------------------------------------------------------
Summary of changes:
gnulib | 2 +-
src/main.c | 4 ++--
src/system.h | 39 ---------------------------------------
3 files changed, 3 insertions(+), 42 deletions(-)
hooks/post-receive
--
grep
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- grep branch, master, updated. v2.10-31-gca0d4f3,
Paul Eggert <=