]> sjero.net Git - wget/blobdiff - src/utils.c
Use Gnulib's alloc functions throughout the source.
[wget] / src / utils.c
index df4ce20858849a5ba2b3db9ad754a1a97c1d1471..d1366ef9e1ee84a1b8b98e21e935a454ed168e37 100644 (file)
@@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
 shall include the source code for the parts of OpenSSL used as well
 as that of the covered work.  */
 
+#define USE_GNULIB_ALLOC
+
 #include "wget.h"
 
 #include <stdio.h>
@@ -322,14 +324,7 @@ fork_to_background (void)
   /* Whether we arrange our own version of opt.lfilename here.  */
   bool logfile_changed = false;
 
-  if (opt.quiet && !opt.server_response)
-    {
-      /* Don't bother with a logfile, there are virtually no logs we
-         issue in quiet mode. (Server responses in FTP are the
-         exception, when enabled.) */
-      log_close ();
-    }
-  if (!opt.lfilename)
+  if (!opt.lfilename && (!opt.quiet || opt.server_response))
     {
       /* We must create the file immediately to avoid either a race
          condition (which arises from using unique_name and failing to
@@ -353,10 +348,9 @@ fork_to_background (void)
   else if (pid != 0)
     {
       /* parent, no error */
-      if (!quiet)
-        printf (_("Continuing in background, pid %d.\n"), (int) pid);
+      printf (_("Continuing in background, pid %d.\n"), (int) pid);
       if (logfile_changed)
-        printf (_("Output will be written to `%s'.\n"), opt.lfilename);
+        printf (_("Output will be written to %s.\n"), quote (opt.lfilename));
       exit (0);                 /* #### should we use _exit()? */
     }
 
@@ -402,8 +396,8 @@ remove_link (const char *file)
       DEBUGP (("Unlinking %s (symlink).\n", file));
       err = unlink (file);
       if (err != 0)
-        logprintf (LOG_VERBOSE, _("Failed to unlink symlink `%s': %s\n"),
-                   file, strerror (errno));
+        logprintf (LOG_VERBOSE, _("Failed to unlink symlink %s: %s\n"),
+                   quote (file), strerror (errno));
     }
   return err;
 }