coreutils
[Top][All Lists]
Advanced

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

[PATCH 2/2] maint: xsetmode renamed to xbinary-io


From: Paul Eggert
Subject: [PATCH 2/2] maint: xsetmode renamed to xbinary-io
Date: Thu, 16 Feb 2017 00:42:01 -0800

* bootstrap.conf, src/base64.c, src/cat.c, src/cksum.c:
* src/head.c, src/md5sum.c, src/od.c, src/split.c, src/sum.c:
* src/tac.c, src/tail.c, src/tee.c, src/tr.c, src/wc.c:
Adjust to renaming of the xsetmode module to xbinary-io,
and of the xsetmode function to xset_binary_mode.
---
 bootstrap.conf | 2 +-
 src/base64.c   | 4 ++--
 src/cat.c      | 6 +++---
 src/cksum.c    | 4 ++--
 src/head.c     | 6 +++---
 src/md5sum.c   | 4 ++--
 src/od.c       | 4 ++--
 src/split.c    | 4 ++--
 src/sum.c      | 6 +++---
 src/tac.c      | 6 +++---
 src/tail.c     | 8 ++++----
 src/tee.c      | 6 +++---
 src/tr.c       | 6 +++---
 src/wc.c       | 4 ++--
 14 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index a1e3523..27ac978 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -269,6 +269,7 @@ gnulib_modules="
   winsz-termios
   write-any-file
   xalloc
+  xbinary-io
   xdectoint
   xfts
   xgetcwd
@@ -279,7 +280,6 @@ gnulib_modules="
   xprintf
   xprintf-posix
   xreadlink
-  xsetmode
   xstrtod
   xstrtoimax
   xstrtol
diff --git a/src/base64.c b/src/base64.c
index d5d75dc..d005c26 100644
--- a/src/base64.c
+++ b/src/base64.c
@@ -31,7 +31,7 @@
 #include "quote.h"
 #include "xstrtol.h"
 #include "xdectoint.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
 
 #define AUTHORS proper_name ("Simon Josefsson")
 
@@ -320,7 +320,7 @@ main (int argc, char **argv)
 
   if (STREQ (infile, "-"))
     {
-      xsetmode (STDIN_FILENO, O_BINARY);
+      xset_binary_mode (STDIN_FILENO, O_BINARY);
       input_fh = stdin;
     }
   else
diff --git a/src/cat.c b/src/cat.c
index fba721f..995dc61 100644
--- a/src/cat.c
+++ b/src/cat.c
@@ -39,7 +39,7 @@
 #include "fadvise.h"
 #include "full-write.h"
 #include "safe-read.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
 
 /* The official name of this program (e.g., no 'g' prefix).  */
 #define PROGRAM_NAME "cat"
@@ -645,7 +645,7 @@ main (int argc, char **argv)
   if (! (number || show_ends || squeeze_blank))
     {
       file_open_mode |= O_BINARY;
-      xsetmode (STDOUT_FILENO, O_BINARY);
+      xset_binary_mode (STDOUT_FILENO, O_BINARY);
     }
 
   /* Check if any of the input files are the same as the output file.  */
@@ -665,7 +665,7 @@ main (int argc, char **argv)
           have_read_stdin = true;
           input_desc = STDIN_FILENO;
           if (file_open_mode & O_BINARY)
-            xsetmode (STDIN_FILENO, O_BINARY);
+            xset_binary_mode (STDIN_FILENO, O_BINARY);
         }
       else
         {
diff --git a/src/cksum.c b/src/cksum.c
index 65702a3..b1a8f0c 100644
--- a/src/cksum.c
+++ b/src/cksum.c
@@ -44,7 +44,7 @@
 #include <stdint.h>
 #include "system.h"
 #include "fadvise.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
 
 #ifdef CRCTAB
 
@@ -194,7 +194,7 @@ cksum (const char *file, bool print_name)
     {
       fp = stdin;
       have_read_stdin = true;
-      xsetmode (STDIN_FILENO, O_BINARY);
+      xset_binary_mode (STDIN_FILENO, O_BINARY);
     }
   else
     {
diff --git a/src/head.c b/src/head.c
index 49c942f..d284b30 100644
--- a/src/head.c
+++ b/src/head.c
@@ -37,8 +37,8 @@
 #include "quote.h"
 #include "safe-read.h"
 #include "stat-size.h"
+#include "xbinary-io.h"
 #include "xdectoint.h"
-#include "xsetmode.h"
 
 /* The official name of this program (e.g., no 'g' prefix).  */
 #define PROGRAM_NAME "head"
@@ -878,7 +878,7 @@ head_file (const char *filename, uintmax_t n_units, bool 
count_lines,
       have_read_stdin = true;
       fd = STDIN_FILENO;
       filename = _("standard input");
-      xsetmode (STDIN_FILENO, O_BINARY);
+      xset_binary_mode (STDIN_FILENO, O_BINARY);
     }
   else
     {
@@ -1082,7 +1082,7 @@ main (int argc, char **argv)
                ? (char const *const *) &argv[optind]
                : default_file_list);
 
-  xsetmode (STDOUT_FILENO, O_BINARY);
+  xset_binary_mode (STDOUT_FILENO, O_BINARY);
 
   for (i = 0; file_list[i]; ++i)
     ok &= head_file (file_list[i], n_units, count_lines, elide_from_end);
diff --git a/src/md5sum.c b/src/md5sum.c
index 19dac08..e58a68e 100644
--- a/src/md5sum.c
+++ b/src/md5sum.c
@@ -46,7 +46,7 @@
 #include "error.h"
 #include "fadvise.h"
 #include "stdio--.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
 
 /* The official name of this program (e.g., no 'g' prefix).  */
 #if HASH_ALGO_MD5
@@ -598,7 +598,7 @@ digest_file (const char *filename, int *binary, unsigned 
char *bin_result,
           if (*binary < 0)
             *binary = ! isatty (STDIN_FILENO);
           if (*binary)
-            xsetmode (STDIN_FILENO, O_BINARY);
+            xset_binary_mode (STDIN_FILENO, O_BINARY);
         }
     }
   else
diff --git a/src/od.c b/src/od.c
index 0da85da..f469326 100644
--- a/src/od.c
+++ b/src/od.c
@@ -29,8 +29,8 @@
 #include "ftoastr.h"
 #include "quote.h"
 #include "stat-size.h"
+#include "xbinary-io.h"
 #include "xprintf.h"
-#include "xsetmode.h"
 #include "xstrtol.h"
 
 /* The official name of this program (e.g., no 'g' prefix).  */
@@ -914,7 +914,7 @@ open_next_file (void)
           input_filename = _("standard input");
           in_stream = stdin;
           have_read_stdin = true;
-          xsetmode (STDIN_FILENO, O_BINARY);
+          xset_binary_mode (STDIN_FILENO, O_BINARY);
         }
       else
         {
diff --git a/src/split.c b/src/split.c
index 8bed1d3..9662336 100644
--- a/src/split.c
+++ b/src/split.c
@@ -38,8 +38,8 @@
 #include "quote.h"
 #include "safe-read.h"
 #include "sig2str.h"
+#include "xbinary-io.h"
 #include "xdectoint.h"
-#include "xsetmode.h"
 #include "xstrtol.h"
 
 /* The official name of this program (e.g., no 'g' prefix).  */
@@ -1553,7 +1553,7 @@ main (int argc, char **argv)
          quoteaf (infile));
 
   /* Binary I/O is safer when byte counts are used.  */
-  xsetmode (STDIN_FILENO, O_BINARY);
+  xset_binary_mode (STDIN_FILENO, O_BINARY);
 
   /* Get the optimal block size of input device and make a buffer.  */
 
diff --git a/src/sum.c b/src/sum.c
index 7a13abe..cae5d37 100644
--- a/src/sum.c
+++ b/src/sum.c
@@ -29,7 +29,7 @@
 #include "fadvise.h"
 #include "human.h"
 #include "safe-read.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
 
 /* The official name of this program (e.g., no 'g' prefix).  */
 #define PROGRAM_NAME "sum"
@@ -98,7 +98,7 @@ bsd_sum_file (const char *file, int print_name)
     {
       fp = stdin;
       have_read_stdin = true;
-      xsetmode (STDIN_FILENO, O_BINARY);
+      xset_binary_mode (STDIN_FILENO, O_BINARY);
     }
   else
     {
@@ -167,7 +167,7 @@ sysv_sum_file (const char *file, int print_name)
     {
       fd = STDIN_FILENO;
       have_read_stdin = true;
-      xsetmode (STDIN_FILENO, O_BINARY);
+      xset_binary_mode (STDIN_FILENO, O_BINARY);
     }
   else
     {
diff --git a/src/tac.c b/src/tac.c
index 41c4f99..4e06b76 100644
--- a/src/tac.c
+++ b/src/tac.c
@@ -48,7 +48,7 @@ tac -r -s '.\|
 #include "filenamecat.h"
 #include "safe-read.h"
 #include "stdlib--.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
 
 /* The official name of this program (e.g., no 'g' prefix).  */
 #define PROGRAM_NAME "tac"
@@ -572,7 +572,7 @@ tac_file (const char *filename)
       have_read_stdin = true;
       fd = STDIN_FILENO;
       filename = _("standard input");
-      xsetmode (STDIN_FILENO, O_BINARY);
+      xset_binary_mode (STDIN_FILENO, O_BINARY);
     }
   else
     {
@@ -687,7 +687,7 @@ main (int argc, char **argv)
           ? (char const *const *) &argv[optind]
           : default_file_list);
 
-  xsetmode (STDOUT_FILENO, O_BINARY);
+  xset_binary_mode (STDOUT_FILENO, O_BINARY);
 
   {
     size_t i;
diff --git a/src/tail.c b/src/tail.c
index dbd2104..d1552d4 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -43,9 +43,9 @@
 #include "safe-read.h"
 #include "stat-size.h"
 #include "stat-time.h"
-#include "xnanosleep.h"
+#include "xbinary-io.h"
 #include "xdectoint.h"
-#include "xsetmode.h"
+#include "xnanosleep.h"
 #include "xstrtol.h"
 #include "xstrtod.h"
 
@@ -1894,7 +1894,7 @@ tail_file (struct File_spec *f, uintmax_t n_units)
     {
       have_read_stdin = true;
       fd = STDIN_FILENO;
-      xsetmode (STDIN_FILENO, O_BINARY);
+      xset_binary_mode (STDIN_FILENO, O_BINARY);
     }
   else
     fd = open (f->name, O_RDONLY | O_BINARY);
@@ -2323,7 +2323,7 @@ main (int argc, char **argv)
       || (header_mode == multiple_files && n_files > 1))
     print_headers = true;
 
-  xsetmode (STDOUT_FILENO, O_BINARY);
+  xset_binary_mode (STDOUT_FILENO, O_BINARY);
 
   for (i = 0; i < n_files; i++)
     ok &= tail_file (&F[i], n_units);
diff --git a/src/tee.c b/src/tee.c
index 5f04bfc..4a6885c 100644
--- a/src/tee.c
+++ b/src/tee.c
@@ -27,7 +27,7 @@
 #include "error.h"
 #include "fadvise.h"
 #include "stdio--.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
 
 /* The official name of this program (e.g., no 'g' prefix).  */
 #define PROGRAM_NAME "tee"
@@ -194,8 +194,8 @@ tee_files (int nfiles, char **files)
      ? (append ? "ab" : "wb")
      : (append ? "a" : "w"));
 
-  xsetmode (STDIN_FILENO, O_BINARY);
-  xsetmode (STDOUT_FILENO, O_BINARY);
+  xset_binary_mode (STDIN_FILENO, O_BINARY);
+  xset_binary_mode (STDOUT_FILENO, O_BINARY);
   fadvise (stdin, FADVISE_SEQUENTIAL);
 
   /* Set up FILES[0 .. NFILES] and DESCRIPTORS[0 .. NFILES].
diff --git a/src/tr.c b/src/tr.c
index 724297c..0c770d7 100644
--- a/src/tr.c
+++ b/src/tr.c
@@ -29,7 +29,7 @@
 #include "fadvise.h"
 #include "quote.h"
 #include "safe-read.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
 #include "xstrtol.h"
 
 /* The official name of this program (e.g., no 'g' prefix).  */
@@ -1786,8 +1786,8 @@ main (int argc, char **argv)
   /* Use binary I/O, since 'tr' is sometimes used to transliterate
      non-printable characters, or characters which are stripped away
      by text-mode reads (like CR and ^Z).  */
-  xsetmode (STDIN_FILENO, O_BINARY);
-  xsetmode (STDOUT_FILENO, O_BINARY);
+  xset_binary_mode (STDIN_FILENO, O_BINARY);
+  xset_binary_mode (STDOUT_FILENO, O_BINARY);
   fadvise (stdin, FADVISE_SEQUENTIAL);
 
   if (squeeze_repeats && non_option_args == 1)
diff --git a/src/wc.c b/src/wc.c
index a587b2c..be4f306 100644
--- a/src/wc.c
+++ b/src/wc.c
@@ -36,7 +36,7 @@
 #include "readtokens0.h"
 #include "safe-read.h"
 #include "stat-size.h"
-#include "xsetmode.h"
+#include "xbinary-io.h"
 
 #if !defined iswspace && !HAVE_ISWSPACE
 # define iswspace(wc) \
@@ -556,7 +556,7 @@ wc_file (char const *file, struct fstatus *fstatus)
   if (! file || STREQ (file, "-"))
     {
       have_read_stdin = true;
-      xsetmode (STDIN_FILENO, O_BINARY);
+      xset_binary_mode (STDIN_FILENO, O_BINARY);
       return wc (STDIN_FILENO, file, fstatus, -1);
     }
   else
-- 
2.9.3




reply via email to

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