This is the mail archive of the cygwin-apps-cvs mailing list for the cygwin-apps project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[setup] branch master, updated. release_2.870-8-g517df8c




https://sourceware.org/git/gitweb.cgi?p=cygwin-setup.git;h=517df8cb7d3c81d24db3804060b34efcdca0d12d

commit 517df8cb7d3c81d24db3804060b34efcdca0d12d
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date:   Fri Mar 6 13:46:21 2015 +0000

    Log errors from archive_tar.cc
    
    archive_tar.cc contains some output directly using fprintf(stderr,), convert
    that to using the printf-style log adaptors.
    
    ChangeLog:
    
    2015-03-04  Jon TURNEY  <jon.turney@dronecode.org.uk>
    
    	* archive_tar.cc (archive_tar): Convert from fprintf(stderr, ...)
    	to LogBabblePrintf() or LogPlainPrintf() as appropriate.


Diff:
---
 ChangeLog      |    5 +++++
 archive_tar.cc |   25 +++++++++++--------------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6c7327e..4238b3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2015-03-04  Jon TURNEY  <jon.turney@dronecode.org.uk>
 
+	* archive_tar.cc (archive_tar): Convert from fprintf(stderr, ...)
+	to LogBabblePrintf() or LogPlainPrintf() as appropriate.
+
+2015-03-04  Jon TURNEY  <jon.turney@dronecode.org.uk>
+
 	* msg.cc (msg): Remove.
 	* msg.h (msg): Ditto.
 	* compress_xz.cc (read, bid_xz, bid_lzma): Convert from msg() to
diff --git a/archive_tar.cc b/archive_tar.cc
index 71dcb57..57c3a8d 100644
--- a/archive_tar.cc
+++ b/archive_tar.cc
@@ -47,17 +47,13 @@ static int err;
 static char buf[512];
 
 int _tar_verbose = 0;
-FILE *_tar_vfile = 0;
-#define vp if (_tar_verbose) fprintf
-#define vp2 if (_tar_verbose>1) fprintf
 
 archive_tar::archive_tar (io_stream * original)
 {
   archive_children = 0;
-  if (_tar_vfile == 0)
-    _tar_vfile = stderr;
 
-  vp2 (_tar_vfile, "tar: open `%p'\n", original);
+  if (_tar_verbose)
+    LogBabblePrintf("tar: open `%p'\n", original);
 
   if (!original)
     {
@@ -170,8 +166,9 @@ archive_tar::next_file_name ()
   sscanf (state.tar_header.size, "%Io", &state.file_length);
   state.file_offset = 0;
 
-//  vp2 (_tar_vfile, "%c %9d %s\n", state.tar_header.typeflag,
-//      state.file_length, state.filename);
+  if (_tar_verbose)
+    LogBabblePrintf ("%c %9d %s\n", state.tar_header.typeflag,
+                     state.file_length, state.filename);
 
   switch (state.tar_header.typeflag)
     {
@@ -182,8 +179,8 @@ archive_tar::next_file_name ()
       if (state.file_length > CYG_PATH_MAX)
 	{
 	  skip_file ();
-	  fprintf (stderr, "error: long file name exceeds %d characters\n",
-		   CYG_PATH_MAX);
+	  LogPlainPrintf( "error: long file name exceeds %d characters\n",
+                          CYG_PATH_MAX);
 	  err++;
 	  state.parent->read (&state.tar_header, 512);
 	  sscanf (state.tar_header.size, "%Io", &state.file_length);
@@ -215,8 +212,8 @@ archive_tar::next_file_name ()
     case '3':			/* char */
     case '4':			/* block */
     case '6':			/* fifo */
-      fprintf (stderr, "warning: not extracting special file %s\n",
-	       state.filename);
+      LogPlainPrintf ("warning: not extracting special file %s\n",
+                      state.filename);
       err++;
       return next_file_name ();
 
@@ -233,8 +230,8 @@ archive_tar::next_file_name ()
       return state.filename;
 
     default:
-      fprintf (stderr, "error: unknown (or unsupported) file type `%c'\n",
-	       state.tar_header.typeflag);
+      LogPlainPrintf ("error: unknown (or unsupported) file type `%c'\n",
+                      state.tar_header.typeflag);
       err++;
       skip_file ();
       return next_file_name ();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]