]> cygwin.com Git - cygwin-apps/setup.git/blobdiff - archive_tar_file.cc
2003-02-16 Pavel Tsekov <ptsekov@gmx.net>
[cygwin-apps/setup.git] / archive_tar_file.cc
index 89f62d22b0483bb8ad9f7fdcbeef0a67a4ecae5b..dbf84d73fce7df93c31d1dd05f4da9b4d2dcc9ee 100644 (file)
 static const char *cvsid = "\n%%% $Id$\n";
 #endif
 
-#include "win32.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/fcntl.h>
 #include <errno.h>
+#include <algorithm>
 
 #include "zlib/zlib.h"
 #include "io_stream.h"
@@ -32,7 +28,6 @@ static const char *cvsid = "\n%%% $Id$\n";
 #include "archive.h"
 #include "archive_tar.h"
 #include "log.h"
-#include "concat.h"
 
 #include "port.h"
 
@@ -43,6 +38,7 @@ archive_tar_file::archive_tar_file (tar_state & newstate):state (newstate)
 archive_tar_file::~archive_tar_file ()
 {
   state.header_read = 0;
+  destroyed = 1;
 }
 
 /* Virtual memebrs */
@@ -50,7 +46,7 @@ ssize_t archive_tar_file::read (void *buffer, size_t len)
 {
   /* how many bytes do we want to give the user */
   int
-    want = min (len, state.file_length - state.file_offset);
+    want = std::min (len, state.file_length - state.file_offset);
   /* how many do we need to read after that to line up the file pointer */
   int
     roundup = (512 - (want % 512)) % 512;
@@ -89,7 +85,7 @@ ssize_t archive_tar_file::write (const void *buffer, size_t len)
 ssize_t archive_tar_file::peek (void *buffer, size_t len)
 {
   int
-    want = min (len, state.file_length - state.file_offset);
+    want = std::min (len, state.file_length - state.file_offset);
   if (want)
     {
       ssize_t
This page took 0.025463 seconds and 5 git commands to generate.