git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1747 77e5149b-7576-45b1-b177-96237e5ba77b
Nigel Horne authored on 2005/11/06 23:41:18... | ... |
@@ -15,13 +15,14 @@ |
15 | 15 |
* along with this program; if not, write to the Free Software |
16 | 16 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | 17 |
*/ |
18 |
-static char const rcsid[] = "$Id: pdf.c,v 1.33 2005/09/22 06:34:18 nigelhorne Exp $"; |
|
18 |
+static char const rcsid[] = "$Id: pdf.c,v 1.34 2005/11/06 14:41:18 nigelhorne Exp $"; |
|
19 | 19 |
|
20 | 20 |
#if HAVE_CONFIG_H |
21 | 21 |
#include "clamav-config.h" |
22 | 22 |
#endif |
23 | 23 |
|
24 | 24 |
#include "clamav.h" |
25 |
+#include "others.h" |
|
25 | 26 |
|
26 | 27 |
#if HAVE_MMAP |
27 | 28 |
#if HAVE_SYS_MMAN_H |
... | ... |
@@ -31,6 +32,7 @@ static char const rcsid[] = "$Id: pdf.c,v 1.33 2005/09/22 06:34:18 nigelhorne Ex |
31 | 31 |
#endif |
32 | 32 |
#endif |
33 | 33 |
|
34 |
+#if HAVE_MMAP |
|
34 | 35 |
#include <stdio.h> |
35 | 36 |
#include <sys/types.h> |
36 | 37 |
#include <sys/stat.h> |
... | ... |
@@ -47,7 +49,6 @@ static char const rcsid[] = "$Id: pdf.c,v 1.33 2005/09/22 06:34:18 nigelhorne Ex |
47 | 47 |
|
48 | 48 |
#include "table.h" |
49 | 49 |
#include "mbox.h" |
50 |
-#include "others.h" |
|
51 | 50 |
#include "blob.h" |
52 | 51 |
|
53 | 52 |
#ifndef MIN |
... | ... |
@@ -62,14 +63,9 @@ static const char *pdf_nextobject(const char *ptr, size_t len); |
62 | 62 |
/* |
63 | 63 |
* TODO: handle embedded URLs if (options&CL_SCAN_MAILURL) |
64 | 64 |
*/ |
65 |
- |
|
66 | 65 |
int |
67 | 66 |
cli_pdf(const char *dir, int desc) |
68 | 67 |
{ |
69 |
-#ifndef HAVE_MMAP |
|
70 |
- cli_warnmsg("File not decoded - PDF decoding needs mmap() (for now)\n"); |
|
71 |
- return CL_CLEAN; |
|
72 |
-#else |
|
73 | 68 |
struct stat statb; |
74 | 69 |
off_t size; /* total number of bytes in the file */ |
75 | 70 |
long bytesleft, trailerlength; |
... | ... |
@@ -358,7 +354,6 @@ cli_pdf(const char *dir, int desc) |
358 | 358 |
|
359 | 359 |
cli_dbgmsg("cli_pdf: returning %d\n", rc); |
360 | 360 |
return rc; |
361 |
-#endif |
|
362 | 361 |
} |
363 | 362 |
|
364 | 363 |
/* flate inflation - returns zlib status, e.g. Z_OK */ |
... | ... |
@@ -536,3 +531,11 @@ pdf_nextobject(const char *ptr, size_t len) |
536 | 536 |
} |
537 | 537 |
return NULL; |
538 | 538 |
} |
539 |
+#else /*!HAVE_MMAP*/ |
|
540 |
+int |
|
541 |
+cli_pdf(const char *dir, int desc) |
|
542 |
+{ |
|
543 |
+ cli_warnmsg("File not decoded - PDF decoding needs mmap() (for now)\n"); |
|
544 |
+ return CL_CLEAN; |
|
545 |
+} |
|
546 |
+#endif |