From 2bfdb848fc29e361ff8df8960773917a35dee472 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 6 Mar 2001 18:13:31 +0000 Subject: [PATCH] * tar.cc (tar_open): Use `get_file_size' instead of `stat'. --- ChangeLog | 4 ++++ tar.cc | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a1b8be7..67d9a1bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Mar 6 19:11:00 2000 Corinna Vinschen + + * tar.cc (tar_open): Use `get_file_size' instead of `stat'. + 2001-03-06 Brian Keener * choose.cc (paint): Modify message for nothing to download vs diff --git a/tar.cc b/tar.cc index c7e7dd2e..0db1d2b3 100644 --- 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 #include -#include -#include #include "zlib/zlib.h" #include "tar.h" @@ -34,6 +32,8 @@ static char *cvsid = "\n%%% $Id$\n"; #define NSPERSEC 10000000LL #define SYMLINK_COOKIE "!" +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) -- 2.43.5