#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: compress.c,v 1.75 2014/12/04 15:56:46 christos Exp $")
+FILE_RCSID("@(#)$File: compress.c,v 1.76 2014/12/11 11:47:08 christos Exp $")
#endif
#include "magic.h"
#endif
#include <string.h>
#include <errno.h>
+#include <signal.h>
#if !defined(__MINGW32__) && !defined(WIN32)
#include <sys/ioctl.h>
#endif
size_t i, nsz;
int rv = 0;
int mime = ms->flags & MAGIC_MIME;
+ sig_t osigpipe;
if ((ms->flags & MAGIC_COMPRESS) == 0)
return 0;
+ osigpipe = signal(SIGPIPE, SIG_IGN);
for (i = 0; i < ncompr; i++) {
if (nbytes < compr[i].maglen)
continue;
}
}
error:
+ (void)signal(SIGPIPE, osigpipe);
free(newbuf);
ms->flags |= MAGIC_COMPRESS;
return rv;