version 1.1.1.1.2.1.2.1, 2017/02/19 07:26:20 |
version 1.1.1.1.2.1.2.2, 2017/06/21 16:46:23 |
|
|
#include <stdio.h> |
#include <stdio.h> |
|
|
/* Functions close(2) and read(2) */ |
/* Functions close(2) and read(2) */ |
#ifdef __WATCOMC__ |
#if !defined(_WIN32) && !defined(_WIN64) |
#ifndef __LINUX__ |
# include <unistd.h> |
#include <io.h> |
|
#else |
|
#include <unistd.h> |
|
#endif |
|
#else |
|
# if !defined(WIN32) && !defined(_WIN32) && !defined(_WIN64) |
|
# include <unistd.h> |
|
# endif |
|
#endif |
#endif |
|
|
#ifndef S_ISREG |
#ifndef S_ISREG |
Line 67 filemap(const char *name, |
|
Line 59 filemap(const char *name, |
|
close(fd); |
close(fd); |
return 0; |
return 0; |
} |
} |
|
if (sb.st_size > XML_MAX_CHUNK_LEN) { |
|
close(fd); |
|
return 2; /* Cannot be passed to XML_Parse in one go */ |
|
} |
|
|
nbytes = sb.st_size; |
nbytes = sb.st_size; |
/* malloc will return NULL with nbytes == 0, handle files with size 0 */ |
/* malloc will return NULL with nbytes == 0, handle files with size 0 */ |
if (nbytes == 0) { |
if (nbytes == 0) { |