remove redundant const directives
[platform/upstream/coreutils.git] / src / mkdir.c
index 882c4e1..9644f4c 100644 (file)
@@ -1,10 +1,10 @@
 /* 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
+   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
-   the Free Software Foundation; either version 3, or (at your option)
-   any later version.
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -12,8 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* David MacKenzie <djm@ai.mit.edu>  */
 
 #include "lchmod.h"
 #include "mkdir-p.h"
 #include "modechange.h"
+#include "prog-fprintf.h"
 #include "quote.h"
 #include "savewd.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "mkdir"
 
-#define AUTHORS "David MacKenzie"
-
-/* The name this program was run with. */
-char *program_name;
+#define AUTHORS proper_name ("David MacKenzie")
 
 static struct option const longopts[] =
 {
@@ -106,7 +103,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));
+    prog_fprintf (stdout, o->created_directory_format, quote (dir));
 }
 
 /* Make ancestor directory DIR, whose last component is COMPONENT,
@@ -153,7 +150,7 @@ main (int argc, char **argv)
   options.created_directory_format = NULL;
 
   initialize_main (&argc, &argv);
-  program_name = argv[0];
+  set_program_name (argv[0]);
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
@@ -192,7 +189,7 @@ main (int argc, char **argv)
   if (scontext && setfscreatecon (scontext) < 0)
     error (EXIT_FAILURE, errno,
           _("failed to set default file creation context to %s"),
-          quote (optarg));
+          quote (scontext));
 
   if (options.make_ancestor_function || specified_mode)
     {