]> sjero.net Git - wget/blobdiff - src/mswindows.c
[svn] Logging system bugfixes and improvements.
[wget] / src / mswindows.c
index 178b923119709433d09534e65ef4a2b75637aa4a..f10c61238291b34f1d10702907a6f9e44014e359 100644 (file)
@@ -36,18 +36,35 @@ extern int errno;
 #endif
 
 /* Defined in log.c.  */
-void redirect_output (const char *);
+void log_request_redirect_output PARAMS ((const char *));
 
 static int windows_nt_p;
 
 
 /* Emulation of Unix sleep.  */
+
 unsigned int
 sleep (unsigned seconds)
 {
   return SleepEx (1000 * seconds, TRUE) ? 0U : 1000 * seconds;
 }
 
+/* Emulation of Unix usleep().  This has a granularity of
+   milliseconds, but that's ok because:
+
+   a) Wget is only using it with milliseconds;
+
+   b) You can't rely on usleep's granularity anyway.  If a caller
+   expects usleep to respect every microsecond, he's in for a
+   surprise.  */
+
+int
+usleep (unsigned long usec)
+{
+  SleepEx (usec / 1000, TRUE);
+  return 0;
+}
+
 static char *
 read_registry (HKEY hkey, char *subkey, char *valuename, char *buf, int *len)
 {
@@ -86,10 +103,7 @@ ws_cleanup (void)
 static void
 ws_hangup (void)
 {
-  redirect_output (_("\n\
-CTRL+Break received, redirecting output to `%s'.\n\
-Execution continued in background.\n\
-You may stop Wget by pressing CTRL+ALT+DELETE.\n"));
+  log_request_redirect_output ("CTRL+Break");
 }
 
 void