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 - the official Cygwin setup program used to install Cygwin and keep it up to date] branch master, updated. release_2.877-10-g781a955




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=781a95550688e8bcb1f89a8c3006accab81d5fe7

commit 781a95550688e8bcb1f89a8c3006accab81d5fe7
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Mon Apr 24 18:12:02 2017 +0100

    Remove uses of stderr for reporting file/directory pathname clashes
    
    Convert output which directly used fprintf(stderr,...), which isn't normally
    going anywhere useful, to using logging.


Diff:
---
 ChangeLog            |    7 +++++++
 io_stream_cygfile.cc |    5 ++---
 io_stream_file.cc    |    5 +++--
 mkdir.cc             |    7 +++----
 4 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ce9c007..363a05d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-03-04  Jon TURNEY  <jon.turney@dronecode.org.uk>
+
+	* io_stream_cygfile.cc (remove): Convert from fprintf(stderr, ...)
+	to output to Log stream.
+	* io_stream_file.cc (remove): Ditto.
+	* mkdir.cc (mkdir_p): Ditto.
+
 
 This file is deprecated.  See git log instead.
 
diff --git a/io_stream_cygfile.cc b/io_stream_cygfile.cc
index f014e0e..2d0716f 100644
--- a/io_stream_cygfile.cc
+++ b/io_stream_cygfile.cc
@@ -19,7 +19,6 @@
 #include "mkdir.h"
 #include "mount.h"
 
-#include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <unistd.h>
@@ -209,8 +208,8 @@ io_stream_cygfile::remove (const std::string& path)
 	  swprintf (tmp + len, L"old-%d", i);
 	}
       while (GetFileAttributesW (tmp) != INVALID_FILE_ATTRIBUTES);
-      fprintf (stderr, "warning: moving directory \"%s\" out of the way.\n",
-	       normalise(path).c_str());
+      Log (LOG_TIMESTAMP) << "warning: moving directory \"" << normalise(path).c_str()
+                          << "\" out of the way." << endLog;
       MoveFileW (wpath, tmp);
     }
   return io_stream::remove (std::string ("file://") + cygpath (normalise(path)).c_str());
diff --git a/io_stream_file.cc b/io_stream_file.cc
index cc869d7..650ac90 100644
--- a/io_stream_file.cc
+++ b/io_stream_file.cc
@@ -25,6 +25,7 @@
   
 #include "io_stream_file.h"
 #include "IOStreamProvider.h"
+#include "LogSingleton.h"
 
 using namespace std;
 
@@ -128,8 +129,8 @@ io_stream_file::remove (const std::string& path)
 	  swprintf (tmp + len, L"old-%d", i);
 	}
       while (GetFileAttributesW (tmp) != INVALID_FILE_ATTRIBUTES);
-      fprintf (stderr, "warning: moving directory \"%s\" out of the way.\n",
-	       path.c_str());
+      Log (LOG_TIMESTAMP) << "warning: moving directory \"" << path.c_str()
+                          << "\" out of the way." << endLog;
       MoveFileW (wpath, tmp);
     }
   SetFileAttributesW (wpath, w & ~FILE_ATTRIBUTE_READONLY);
diff --git a/mkdir.cc b/mkdir.cc
index e683a71..20a9ba6 100644
--- a/mkdir.cc
+++ b/mkdir.cc
@@ -19,10 +19,10 @@
 #include "ntdll.h"
 
 #include <sys/stat.h>
-#include <stdio.h>
 
 #include "mkdir.h"
 #include "filemanip.h"
+#include "LogSingleton.h"
 
 /* Return 0 on success.
    A mode of 0 means no POSIX perms. */
@@ -81,9 +81,8 @@ mkdir_p (int isadir, const char *in_path, mode_t mode)
 	{
 	  if (gse == ERROR_ALREADY_EXISTS)
 	    {
-	      fprintf (stderr,
-		       "warning: deleting \"%s\" so I can make a directory there\n",
-		       path);
+              Log (LOG_TIMESTAMP) << "warning: deleting \"" << path
+                                  << "\" so I can make a directory there" << endLog;
 	      if (DeleteFileW (wpath))
 		return mkdir_p (isadir, path, mode ? 0755 : 0);
 	    }


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