partimage 0.6.9 bug with zlib

If you want to contribute to Partimage, please post there

Moderator: feffer

madler
Posts: 1
Joined: Sat Feb 04, 2012 11:36 pm

partimage 0.6.9 bug with zlib

Postby madler » Sat Feb 04, 2012 11:40 pm

partimage erroneously uses gzFile * instead of gzFile. The patch below corrects this. Without this patch, partimage will not compile with zlib 1.2.6.

Code: Select all

diff --git a/src/client/imagefile.cpp b/src/client/imagefile.cpp
index dd83411..62d0f72 100644
--- a/src/client/imagefile.cpp
+++ b/src/client/imagefile.cpp
@@ -783,7 +783,7 @@ void CImage::openWriting()
   else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression
     {
       showDebug(1, "open gzip\n");
-      m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "wb"); //"wb1h");
+      m_gzImageFile = gzdopen(m_nFdImage, "wb"); //"wb1h");
       if (m_gzImageFile == NULL)
    {
      showDebug(1, "error:%d %s\n", errno, strerror(errno));
@@ -1098,7 +1098,7 @@ void CImage::openReading(CVolumeHeader *vh /* = NULL */)
     }
   else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression
     {
-      m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "rb");
+      m_gzImageFile = gzdopen(m_nFdImage, "rb");
       if (m_gzImageFile == NULL)
         THROW(ERR_ERRNO, errno);
       else
diff --git a/src/client/imagefile.h b/src/client/imagefile.h
index 4ba8910..6adb098 100644
--- a/src/client/imagefile.h
+++ b/src/client/imagefile.h
@@ -41,7 +41,7 @@ class CImage
   COptions m_options;
 
   FILE *m_fImageFile;
-  gzFile *m_gzImageFile;
+  gzFile m_gzImageFile;
   BZFILE *m_bzImageFile;
 
   int m_nFdImage;

Return to “Contributions”

Who is online

Users browsing this forum: No registered users and 1 guest