]> sjero.net Git - wget/blobdiff - src/mswindows.c
[svn] Unify Windows-related config.h files into windows/config.h and
[wget] / src / mswindows.c
index d1867fcf9c512ad8bed4d062f47e66c74c818a9d..4c77ab1c61b02041b37168d1ff2d16ca733ee09d 100644 (file)
@@ -1,6 +1,5 @@
 /* mswindows.c -- Windows-specific support
-   Copyright (C) 1995, 1996, 1997, 1998, 2004
-   Free Software Foundation, Inc.
+   Copyright (C) 1996-2005 Free Software Foundation, Inc.
 
 This file is part of GNU Wget.
 
@@ -15,8 +14,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with Wget; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+along with Wget; if not, write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 
 In addition, as a special exception, the Free Software Foundation
 gives permission to link the code of its release of Wget with the
@@ -37,17 +36,6 @@ so, delete this exception statement from your version.  */
 #include <errno.h>
 #include <math.h>
 
-#ifdef HACK_BCC_UTIME_BUG
-# include <io.h>
-# include <fcntl.h>
-# ifdef HAVE_UTIME_H
-#  include <utime.h>
-# endif
-# ifdef HAVE_SYS_UTIME_H
-#  include <sys/utime.h>
-# endif
-#endif
-
 #define INHIBIT_WRAP /* avoid wrapping of socket, bind, ... */
 
 #include "wget.h"
@@ -78,7 +66,7 @@ xsleep (double seconds)
       sleep (seconds);
       seconds -= (long) seconds;
     }
-  usleep (seconds * 1000000L);
+  usleep (seconds * 1000000);
 #else  /* not HAVE_USLEEP */
   SleepEx ((DWORD) (seconds * 1000 + .5), FALSE);
 #endif /* not HAVE_USLEEP */
@@ -607,34 +595,6 @@ ws_startup (void)
   set_sleep_mode ();
   SetConsoleCtrlHandler (ws_handler, TRUE);
 }
-
-/* Replacement utime function for buggy Borland C++Builder 5.5 compiler.
-   (The Borland utime function only works on Windows NT.)  */
-
-#ifdef HACK_BCC_UTIME_BUG
-int
-borland_utime (const char *path, const struct utimbuf *times)
-{
-  int fd;
-  int res;
-  struct ftime ft;
-  struct tm *ptr_tm;
-
-  if ((fd = open (path, O_RDWR)) < 0)
-    return -1;
-
-  ptr_tm = localtime (&times->modtime);
-  ft.ft_tsec = ptr_tm->tm_sec >> 1;
-  ft.ft_min = ptr_tm->tm_min;
-  ft.ft_hour = ptr_tm->tm_hour;
-  ft.ft_day = ptr_tm->tm_mday;
-  ft.ft_month = ptr_tm->tm_mon + 1;
-  ft.ft_year = ptr_tm->tm_year - 80;
-  res = setftime (fd, &ft);
-  close (fd);
-  return res;
-}
-#endif
 \f
 /* run_with_timeout Windows implementation.  */
 
@@ -710,7 +670,7 @@ run_with_timeout (double seconds, void (*fun) (void *), void *arg)
                             &thread_arg, 0, &thread_id);
   if (!thread_hnd)
     {
-      DEBUGP (("CreateThread() failed; %s\n", strerror (GetLastError ())));
+      DEBUGP (("CreateThread() failed; [0x%x]\n", GetLastError ()));
       goto blocking_fallback;
     }
 
@@ -753,6 +713,8 @@ run_with_timeout (double seconds, void (*fun) (void *), void *arg)
 WRAP (socket, (int domain, int type, int protocol), (domain, type, protocol))
 WRAP (bind, (int s, struct sockaddr *a, int alen), (s, a, alen))
 WRAP (connect, (int s, const struct sockaddr *a, int alen), (s, a, alen))
+WRAP (listen, (int s, int backlog), (s, backlog))
+WRAP (accept, (int s, struct sockaddr *a, int *alen), (s, a, alen))
 WRAP (recv, (int s, void *buf, int len, int flags), (s, buf, len, flags))
 WRAP (send, (int s, const void *buf, int len, int flags), (s, buf, len, flags))
 WRAP (select, (int n, fd_set *r, fd_set *w, fd_set *e, const struct timeval *tm),