coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[coreutils] two patches required for fedora rawhide


From: Jim Meyering
Subject: [coreutils] two patches required for fedora rawhide
Date: Mon, 24 Jan 2011 10:05:51 +0100

I built on a just-updated rawhide system and encountered two problems.
First, split got a new warning about a used-uninitialized "files" variable.

  split.c: In function 'main':
  split.c:663:9: error: 'files' may be used uninitialized in this function \
    [-Werror=uninitialized]

That's spurious, so I added an IF_LINT initializer.

The next was a test failure due to fstatfs now failing with ENOSYS
(presumably due to the fact this is with linux-2.3.38 RC)
when applied to an input file descriptor that's open on a pipe.
This failure caused a diagnostic that made a test fail.
Since the fstatfs call is solely to determine whether the input
file is remote (not appropriate for inotify), we can treat this
particular failure (ENOSYS) just like the absence of inotify support.

>From 15ea577af7f04c0e9ddbd88fa72768e79a933b60 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 24 Jan 2011 09:38:40 +0100
Subject: [PATCH 2/2] split: avoid a new, spurious warning from gcc-4.6.0

* src/split.c (lines_rr) [IF_LINT]: Initialize files, now that
rawhide's gcc-4.6.0 would otherwise warn about use-uninitialized.
---
 src/split.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/split.c b/src/split.c
index c11c032..364576a 100644
--- a/src/split.c
+++ b/src/split.c
@@ -660,7 +660,7 @@ lines_rr (uintmax_t k, uintmax_t n, char *buf, size_t 
bufsize)
 {
   bool file_limit;
   size_t i_file;
-  of_t *files;
+  of_t *files IF_LINT (= NULL);
   uintmax_t line_no;

   if (k)
--
1.7.3.5.38.gb312b

>From 8264fc615a1beb82e062949e5cf17c852fcfaaaf Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 24 Jan 2011 09:37:10 +0100
Subject: [PATCH 1/2] tail: avoid new diagnostic when applying -f to a pipe on 
linux-2.3.38

* src/tail.c (fremote): Do not print a diagnostic when
fstatfs (pipe_FD, &buf) fails, as it now does on linux-2.3.38.
This avoids the spurious failure of tests/misc/tail's f-pipe-1
test, when running in input-from-pipe mode.
---
 src/tail.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/tail.c b/src/tail.c
index 9682a53..bcd2d99 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -887,8 +887,11 @@ fremote (int fd, const char *name)
   int err = fstatfs (fd, &buf);
   if (err != 0)
     {
-      error (0, errno, _("cannot determine location of %s. "
-                         "reverting to polling"), quote (name));
+      /* On at least linux-2.6.38, fstatfs fails with ENOSYS when FD
+         is open on a pipe.  Treat that like a remote file.  */
+      if (errno != ENOSYS)
+        error (0, errno, _("cannot determine location of %s. "
+                           "reverting to polling"), quote (name));
     }
   else
     {
--
1.7.3.5.38.gb312b



reply via email to

[Prev in Thread] Current Thread [Next in Thread]