From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109535 invoked by alias); 24 Apr 2017 17:20:50 -0000 Mailing-List: contact cygwin-apps-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-apps-cvs-owner@sourceware.org Received: (qmail 109435 invoked by uid 9795); 24 Apr 2017 17:20:48 -0000 Date: Mon, 24 Apr 2017 17:20:00 -0000 Message-ID: <20170424172048.109409.qmail@sourceware.org> From: jturney@sourceware.org To: cygwin-apps-cvs@sourceware.org Subject: [setup - the official Cygwin setup program used to install Cygwin and keep it up to date] branch master, updated. release_2.877-10-g781a955 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: c123d344c7702e8d2d48a378991c130a20e337b8 X-Git-Newrev: 781a95550688e8bcb1f89a8c3006accab81d5fe7 X-SW-Source: 2017-q2/txt/msg00015.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=781a95550688e8bcb1f89a8c3006accab81d5fe7 commit 781a95550688e8bcb1f89a8c3006accab81d5fe7 Author: Jon Turney 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 + + * 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 #include #include #include @@ -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 -#include #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); }