summaryrefslogtreecommitdiff
path: root/src/mkdir.c
diff options
context:
space:
mode:
authorSteven Schubiger <schubiger@gmail.com>2008-02-06 08:25:24 +0100
committerJim Meyering <meyering@redhat.com>2008-02-07 08:26:48 +0100
commita09dadf1004aa07e2c31d95d6c80247fec1fa646 (patch)
treec2d51188fa2964fce85927f5d2dad057fb67b17c /src/mkdir.c
parent0981b56f266002d607236cbe0aa407b9ab631ad7 (diff)
downloadcoreutils-a09dadf1004aa07e2c31d95d6c80247fec1fa646.tar.xz
mkdir, split: write --verbose output to stdout, not stderr.
* src/mkdir.c (verbose_output): New function. (announce_mkdir): Use it. * src/split.c (usage): Update. * src/split.c (cwrite): Write to stdout, not stderr. * doc/coreutils.texi (split invocation): Remove the mention of --verbose output being printed to stderr. * tests/mkdir/p-v: Redirect stdout, not stderr. * tests/misc/split-a: Likewise. * NEWS: Mention this change. * TODO: Remove this item.
Diffstat (limited to 'src/mkdir.c')
-rw-r--r--src/mkdir.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mkdir.c b/src/mkdir.c
index 070407718..378106501 100644
--- a/src/mkdir.c
+++ b/src/mkdir.c
@@ -1,5 +1,5 @@
/* mkdir -- make directories
- Copyright (C) 90, 1995-2002, 2004-2007 Free Software Foundation, Inc.
+ Copyright (C) 90, 1995-2002, 2004-2008 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -79,6 +79,19 @@ Mandatory arguments to long options are mandatory for short options too.\n\
exit (status);
}
+/* Verbose formatted output of variable count of arguments. */
+static void
+verbose_output (FILE *fp, char const *fmt, ...)
+{
+ va_list ap;
+ fputs (program_name, fp);
+ fputs (": ", fp);
+ va_start (ap, fmt);
+ vfprintf (fp, fmt, ap);
+ va_end (ap);
+ fputc ('\n', fp);
+}
+
/* Options passed to subsidiary functions. */
struct mkdir_options
{
@@ -105,7 +118,7 @@ announce_mkdir (char const *dir, void *options)
{
struct mkdir_options const *o = options;
if (o->created_directory_format)
- error (0, 0, o->created_directory_format, quote (dir));
+ verbose_output (stdout, o->created_directory_format, quote (dir));
}
/* Make ancestor directory DIR, whose last component is COMPONENT,