mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2025-10-20 19:03:17 +00:00
Added CYGWIN support
git-svn: trunk@835
This commit is contained in:
parent
ef822cfc14
commit
7efb18383b
1 changed files with 19 additions and 2 deletions
|
@ -20,6 +20,9 @@
|
||||||
*
|
*
|
||||||
* Change History:
|
* Change History:
|
||||||
* $Log: untar.c,v $
|
* $Log: untar.c,v $
|
||||||
|
* Revision 1.5 2004/09/06 14:16:48 nigelhorne
|
||||||
|
* Added CYGWIN support
|
||||||
|
*
|
||||||
* Revision 1.4 2004/09/06 08:45:44 nigelhorne
|
* Revision 1.4 2004/09/06 08:45:44 nigelhorne
|
||||||
* Code Tidy
|
* Code Tidy
|
||||||
*
|
*
|
||||||
|
@ -33,7 +36,7 @@
|
||||||
* First draft
|
* First draft
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static char const rcsid[] = "$Id: untar.c,v 1.4 2004/09/06 08:45:44 nigelhorne Exp $";
|
static char const rcsid[] = "$Id: untar.c,v 1.5 2004/09/06 14:16:48 nigelhorne Exp $";
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -50,6 +53,20 @@ static char const rcsid[] = "$Id: untar.c,v 1.4 2004/09/06 08:45:44 nigelhorne E
|
||||||
|
|
||||||
#define BLOCKSIZE 512
|
#define BLOCKSIZE 512
|
||||||
|
|
||||||
|
/* Maximum filenames under various systems */
|
||||||
|
#ifndef NAME_MAX /* e.g. Linux */
|
||||||
|
|
||||||
|
#ifdef MAXNAMELEN /* e.g. Solaris */
|
||||||
|
#define NAME_MAX MAXNAMELEN
|
||||||
|
#else
|
||||||
|
|
||||||
|
#ifdef FILENAME_MAX /* e.g. SCO */
|
||||||
|
#define NAME_MAX FILENAME_MAX
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
static int
|
static int
|
||||||
octal(const char *str)
|
octal(const char *str)
|
||||||
{
|
{
|
||||||
|
@ -71,7 +88,7 @@ cli_untar(const char *dir, int desc)
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
char block[BLOCKSIZE];
|
char block[BLOCKSIZE];
|
||||||
const int nread = read(desc, block, sizeof(block));
|
const int nread = cli_readn(desc, block, sizeof(block));
|
||||||
|
|
||||||
if(!in_block && nread == 0)
|
if(!in_block && nread == 0)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue