Branch: Tag:

2007-07-03

2007-07-03 07:01:32 by Martin Stjernholm <mast@lysator.liu.se>

Improved error messages a little.

Rev: src/modules/Gz/zlibmod.c:1.82

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: zlibmod.c,v 1.81 2007/06/02 14:53:23 mbaehr Exp $ + || $Id: zlibmod.c,v 1.82 2007/07/03 07:01:32 mast Exp $   */      #include "global.h"
180:    Pike_error("libz not compatible with zlib.h!!!\n");    break;    +  case Z_MEM_ERROR: +  Pike_error ("Out of memory while initializing Gz.deflate.\n"); +  break; +     default:    if(THIS->gz.msg) -  Pike_error("Failed to initialize gz_deflate: %s\n",THIS->gz.msg); +  Pike_error("Failed to initialize Gz.deflate: %s\n",THIS->gz.msg);    else -  Pike_error("Failed to initialize gz_deflate\n"); +  Pike_error("Failed to initialize Gz.deflate (%d).\n", tmp);    }   }   
269:    Pike_error("libz not compatible with zlib.h!!!\n");    break;    +  case Z_MEM_ERROR: +  Pike_error ("Out of memory while initializing Gz.compress.\n"); +  break; +     default:    deflateEnd(&z.gz);    if(z.gz.msg) -  Pike_error("Failed to initialize gz: %s\n", z.gz.msg); +  Pike_error("Failed to initialize Gz.compress: %s\n", z.gz.msg);    else -  Pike_error("Failed to initialize gz\n"); +  Pike_error("Failed to initialize Gz.compress (%d).\n", ret);    }       mt_init(&z.lock);
515:    Pike_error("libz not compatible with zlib.h!!!\n");    break;    +  case Z_MEM_ERROR: +  Pike_error ("Out of memory while initializing Gz.inflate.\n"); +  break; +     default:    if(THIS->gz.msg) -  Pike_error("Failed to initialize gz_inflate: %s\n",THIS->gz.msg); +  Pike_error("Failed to initialize Gz.inflate: %s\n",THIS->gz.msg);    else -  Pike_error("Failed to initialize gz_inflate\n"); +  Pike_error("Failed to initialize Gz.inflate (%d).\n", tmp);    }   }   
609:    Pike_error("libz not compatible with zlib.h!!!\n");    break;    +  case Z_MEM_ERROR: +  Pike_error ("Out of memory while initializing Gz.uncompress.\n"); +  inflateEnd(&z.gz); +  break; +     default:    inflateEnd( &z.gz );    if(z.gz.msg) -  Pike_error("Failed to initialize gz: %s\n", z.gz.msg); +  Pike_error("Failed to initialize Gz.uncompress: %s\n", z.gz.msg);    else -  Pike_error("Failed to initialize gz\n"); +  Pike_error("Failed to initialize Gz.uncompress (%d).\n", ret);    }       mt_init(&z.lock);