]> cygwin.com Git - cygwin-apps/setup.git/blobdiff - tar.cc
* tar.cc (tar_open): Use `get_file_size' instead of `stat'.
[cygwin-apps/setup.git] / tar.cc
diff --git a/tar.cc b/tar.cc
index c7e7dd2e9348646d99f2d130c5cbcc67ba7c4d82..0db1d2b3c10b6e7eb63678705bb5522e96bf407b 100644 (file)
--- a/tar.cc
+++ b/tar.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, Red Hat, Inc.
+ * Copyright (c) 2000, 2001, Red Hat, 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
@@ -20,8 +20,6 @@ static char *cvsid = "\n%%% $Id$\n";
 #include "win32.h"
 #include <stdio.h>
 #include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 
 #include "zlib/zlib.h"
 #include "tar.h"
@@ -34,6 +32,8 @@ static char *cvsid = "\n%%% $Id$\n";
 #define NSPERSEC 10000000LL
 #define SYMLINK_COOKIE "!<symlink>"
 
+extern DWORD get_file_size (char *);
+
 typedef struct {
   char name[100];               /*   0 */
   char mode[8];                 /* 100 */
@@ -92,14 +92,14 @@ xstrdup (char *c)
 int
 tar_open (char *pathname)
 {
-  struct stat s;
   if (_tar_vfile == 0)
     _tar_vfile = stderr;
 
   vp2 (_tar_vfile, "tar: open `%s'\n", pathname);
-  if (stat (pathname, &s) < 0)
+  DWORD size;
+  if ((size = get_file_size (pathname)) == 0)
     return 1;
-  _tar_file_size = s.st_size;
+  _tar_file_size = size;
 
   g = gzopen (pathname, "rb");
   if (sizeof (tar_header) != 512)
This page took 0.024302 seconds and 5 git commands to generate.