Changeset 191
- Timestamp:
- Oct 30, 2010, 5:23:18 PM (14 years ago)
- Location:
- clamav/trunk
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified clamav/trunk/clamd/clamd.c ¶
r189 r191 544 544 sock_mode = 0777 /* & ~umsk*/; /* conservative default: umask was 0 in clamd < 0.96 */ 545 545 546 #ifndef C_OS2 546 547 if(chmod(optget(opts, "LocalSocket")->strarg, sock_mode & 0666)) { 547 548 logg("!Cannot set socket permission to %s\n", optget(opts, "LocalSocketMode")->strarg); … … 549 550 break; 550 551 } 552 #endif 551 553 552 554 nlsockets++; … … 592 594 } 593 595 594 #if ndef _WIN32596 #if !defined(_WIN32) && !defined(C_OS2) 595 597 if(nlsockets && localsock) { 596 598 opt = optget(opts, "LocalSocket"); -
TabularUnified clamav/trunk/clamd/scanner.c ¶
r189 r191 84 84 /* detect disconnected socket, 85 85 * this should NOT detect half-shutdown sockets (SHUT_WR) */ 86 if (send(scandata->conn->sd, &ret, 0, 0) == -1 && errno != EINTR) { 86 if (send(scandata->conn->sd, &ret, 0, 0) == -1 && errno != EINTR 87 #ifdef C_OS2 88 && errno != EFAULT // YD length==0 may fail on os2 sockets 89 #endif 90 ) { 87 91 logg("$Client disconnected while command was active!\n"); 88 92 thrmgr_group_terminate(scandata->conn->group); … … 121 125 return CL_SUCCESS; 122 126 case warning_skipped_special: 123 if ( msg == scandata->toplevel_path)127 if (!strcmp(msg, scandata->toplevel_path)) 124 128 conn_reply(scandata->conn, msg, "Not supported file type", "ERROR"); 125 129 logg("*Not supported file type: %s\n", msg); … … 140 144 141 145 if(sb && sb->st_size == 0) { /* empty file */ 142 if ( msg == scandata->toplevel_path)146 if (!strcmp(msg, scandata->toplevel_path)) 143 147 conn_reply_single(scandata->conn, filename, "Empty file"); 144 148 free(filename); -
TabularUnified clamav/trunk/clamd/server-th.c ¶
r189 r191 1069 1069 event_wake_recv = CreateEvent(NULL, TRUE, FALSE, NULL); 1070 1070 #else 1071 1072 #ifdef __KLIBC__ 1073 // YD libc select() does not work with pipes 1074 if (socketpair(AF_UNIX, SOCK_STREAM,0, acceptdata.syncpipe_wake_recv) == -1 || 1075 (socketpair(AF_UNIX, SOCK_STREAM,0, acceptdata.syncpipe_wake_accept) == -1)) { 1076 1077 logg("!pipe failed\n"); 1078 exit(-1); 1079 } 1080 #else 1071 1081 if (pipe(acceptdata.syncpipe_wake_recv) == -1 || 1072 1082 (pipe(acceptdata.syncpipe_wake_accept) == -1)) { … … 1075 1085 exit(-1); 1076 1086 } 1087 #endif 1088 1077 1089 syncpipe_wake_recv_w = acceptdata.syncpipe_wake_recv[1]; 1078 1090 -
TabularUnified clamav/trunk/clamd/thrmgr.c ¶
r189 r191 42 42 43 43 /* BSD and HP-UX need a bigger stacksize than the system default */ 44 #if defined (C_BSD) || defined (C_HPUX) || defined(C_AIX) 44 #if defined (C_BSD) || defined (C_HPUX) || defined(C_AIX) || defined(C_OS2) 45 45 #define C_BIGSTACK 1 46 46 #endif -
TabularUnified clamav/trunk/clamdscan/client.c ¶
r189 r191 132 132 return NULL; 133 133 } 134 #if def _WIN32134 #if defined(_WIN32) || defined(C_OS2) 135 135 if(*basepath == '\\') { 136 136 namelen = 2; -
TabularUnified clamav/trunk/clamdtop/Makefile.in ¶
r189 r191 297 297 298 298 @HAVE_CURSES_TRUE@AM_CPPFLAGS = -I$(top_srcdir) @CURSES_CPPFLAGS@ 299 @HAVE_CURSES_TRUE@clamdtop_LDADD = @CURSES_LIBS@ $(top_builddir)/libclamav/libclamav_internal_utils_nothreads.la299 @HAVE_CURSES_TRUE@clamdtop_LDADD = @CURSES_LIBS@ -ltinfo $(top_builddir)/libclamav/libclamav_internal_utils_nothreads.la 300 300 EXTRA_DIST = clamdtop.c 301 301 all: all-am -
TabularUnified clamav/trunk/clamdtop/clamdtop.c ¶
r189 r191 511 511 { 512 512 #else 513 514 #ifdef C_OS2 515 if(cli_is_abspath(soname)) { 516 #else 513 517 if(cli_is_abspath(soname) || (access(soname, F_OK) == 0)) { 518 #endif 514 519 struct sockaddr_un addr; 515 520 s = socket(AF_UNIX, SOCK_STREAM, 0); -
TabularUnified clamav/trunk/clamscan/manager.c ¶
r189 r191 118 118 } 119 119 info.rblocks += fsize / CL_COUNT_PRECISION; 120 #if ndef _WIN32120 #if !defined(_WIN32) && !defined(C_OS2) 121 121 if(geteuid()) 122 122 if(checkaccess(filename, NULL, R_OK) != 1) { … … 617 617 ret = 2; 618 618 } else { 619 #if defined(C_OS2) || defined(_WIN32) 620 // YD skip if 'x:\' pattern is found 621 if (!(strlen(file)==3 && file[1]==':' && file[2]==*PATHSEP)) 622 #endif 619 623 for(i = strlen(file) - 1; i > 0; i--) { 620 624 if(file[i] == *PATHSEP) -
TabularUnified clamav/trunk/clamscan/others.c ¶
r189 r191 86 86 int ret = 0, status; 87 87 88 #if !defined(C_CYGWIN) && !defined(C_OS2) && !defined(C_BEOS) 88 89 if(!geteuid()) { 89 90 … … 118 119 } 119 120 120 } else { 121 } else 122 #endif 123 { 121 124 if(!access(path, mode)) 122 125 ret = 1; -
TabularUnified clamav/trunk/configure ¶
r189 r191 13875 13875 if(!data3) 13876 13876 return 1; 13877 #ifdef __KLIBC__ 13878 lseek(fd,0,SEEK_SET); 13879 #endif 13877 13880 if(read (fd, data3, datasize) != datasize) 13878 13881 return 1; -
TabularUnified clamav/trunk/freshclam/dns.c ¶
r189 r191 49 49 unsigned int cttl, size, txtlen = 0; 50 50 51 #ifdef __KLIBC__ 52 static int res_init_done = 0; 53 #endif 54 51 55 52 56 if(ttl) 53 57 *ttl = 0; 58 #ifdef __KLIBC__ 59 if (res_init_done == 0) 60 #endif 54 61 if(res_init() < 0) { 55 62 logg("^res_init failed\n"); 56 63 return NULL; 57 64 } 65 #ifdef __KLIBC__ 66 res_init_done = 1; // call only once per session 67 #endif 58 68 59 69 logg("*Querying %s\n", domain); -
TabularUnified clamav/trunk/freshclam/execute.c ¶
r189 r191 34 34 #include "execute.h" 35 35 36 #if defined(C_OS2) 37 #include <process.h> 38 #define _P_NOWAIT P_NOWAIT 39 #endif 40 36 41 #define MAX_CHILDREN 5 37 42 … … 53 58 } 54 59 55 #if def _WIN3260 #if defined(_WIN32) || defined(C_OS2) 56 61 if(spawnlp(_P_NOWAIT, text, text, NULL) == -1) { 57 62 logg("^%s: couldn't execute \"%s\".\n", type, text); -
TabularUnified clamav/trunk/freshclam/freshclam.c ¶
r189 r191 259 259 } 260 260 261 #if ndef _WIN32261 #if !defined(_WIN32) && !defined(C_OS2) 262 262 if(statbuf.st_mode & (S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH)) { 263 263 logg("^Insecure permissions (for HTTPProxyPassword): %s must have no more than 0700 permissions.\n", cfgfile); … … 269 269 270 270 #ifdef HAVE_PWD_H 271 #if !defined(C_OS2) 271 272 /* freshclam shouldn't work with root privileges */ 272 273 dbowner = optget(opts, "DatabaseOwner")->strarg; … … 309 310 } 310 311 } 312 #endif /* C_OS2 */ 311 313 #endif /* HAVE_PWD_H */ 312 314 -
TabularUnified clamav/trunk/freshclam/manager.c ¶
r189 r191 1800 1800 } 1801 1801 1802 #if def _WIN321802 #if defined(_WIN32) || defined(C_OS2) 1803 1803 if(!access(newdb, R_OK) && unlink(newdb)) { 1804 1804 logg("!Can't unlink %s. Please fix the problem manually and try again.\n", newdb); -
TabularUnified clamav/trunk/libclamav/Makefile.in ¶
r189 r191 13 13 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 14 # PARTICULAR PURPOSE. 15 16 OS2_LA_NAME=clamav 17 OS2_DLL_NAME=clamav 18 OS2_DLL_OBJ=$(libclamav_la_OBJECTS:%.lo=.libs/%.o) .libs/clamav_internal_utils.a .libs/clamav_nocxx.a 19 OS2_DLL_LIBS=../libltdl/.libs/ltdlc.a .libs/clamunrar_iface.a .libs/clamunrar.a $(LIBCLAMAV_LIBS) $(LIBS) 15 20 16 21 @SET_MAKE@ … … 672 677 @MAINTAINER_MODE_FALSE@CLEANFILES = $(COMMON_CLEANFILES) 673 678 @MAINTAINER_MODE_TRUE@CLEANFILES = $(COMMON_CLEANFILES) @srcdir@/jsparse/generated/operators.h @srcdir@/jsparse/generated/keywords.h 674 all: $(BUILT_SOURCES) 679 all: $(BUILT_SOURCES) $(OS2_DLL_NAME).dll 675 680 $(MAKE) $(AM_MAKEFLAGS) all-recursive 676 681 … … 2349 2354 # Otherwise a system limit (for SysV at least) may be exceeded. 2350 2355 .NOEXPORT: 2356 2357 $(OS2_DLL_NAME).dll: lib$(OS2_LA_NAME).la 2358 cp .libs/$(OS2_LA_NAME).a .libs/$(OS2_LA_NAME)_s.a 2359 echo "LIBRARY $(OS2_DLL_NAME) INITINSTANCE TERMINSTANCE" > $(OS2_DLL_NAME).def 2360 echo "DATA MULTIPLE" >> $(OS2_DLL_NAME).def 2361 echo "EXPORTS" >> $(OS2_DLL_NAME).def 2362 emxexp $(OS2_DLL_OBJ) >> $(OS2_DLL_NAME).def 2363 gcc -g -Zbin-files -Zhigh-mem -Zomf -Zdll $(OS2_DLL_NAME).def -o $@ $(OS2_DLL_OBJ) $(OS2_DLL_LIBS) 2364 emximp -o .libs/$(OS2_LA_NAME).a $(OS2_DLL_NAME).def 2365 emximp -o .libs/$(OS2_LA_NAME).lib $(OS2_DLL_NAME).def -
TabularUnified clamav/trunk/libclamav/c++/configure ¶
r189 r191 14835 14835 i?86|amd64|x86_64|powerpc*) 14836 14836 case "$target_os" in 14837 darwin*|freebsd*|openbsd*|netbsd*|dragonfly*|linux*|solaris*|win32*|mingw* )14837 darwin*|freebsd*|openbsd*|netbsd*|dragonfly*|linux*|solaris*|win32*|mingw*|os2*) 14838 14838 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok ($target_cpu-$target_os)" >&5 14839 14839 $as_echo "ok ($target_cpu-$target_os)" >&6; } -
TabularUnified clamav/trunk/libclamav/c++/llvm/configure ¶
r189 r191 2806 2806 llvm_cv_os_type="Freestanding" 2807 2807 llvm_cv_platform_type="Unix" ;; 2808 *-*-os2*) 2809 llvm_cv_link_all_option="-Wl,--whole-archive" 2810 llvm_cv_no_link_all_option="-Wl,--no-whole-archive" 2811 llvm_cv_os_type="OS/2" 2812 llvm_cv_platform_type="Unix" ;; 2808 2813 *) 2809 2814 llvm_cv_link_all_option="" … … 2856 2861 *-unknown-eabi*) 2857 2862 llvm_cv_target_os_type="Freestanding" ;; 2863 *-*-os2*) 2864 llvm_cv_target_os_type="OS/2" ;; 2858 2865 *) 2859 2866 llvm_cv_target_os_type="Unknown" ;; -
TabularUnified clamav/trunk/libclamav/c++/llvm/lib/System/Mutex.cpp ¶
r189 r191 76 76 assert(errorcode == 0); 77 77 78 #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__) 78 #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__) && !defined(__KLIBC__) 79 79 // Make it a process local mutex 80 80 errorcode = pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_PRIVATE); -
TabularUnified clamav/trunk/libclamav/c++/llvm/lib/System/Unix/Path.inc ¶
r189 r191 59 59 #ifdef __APPLE__ 60 60 #include <mach-o/dyld.h> 61 #endif 62 63 #ifdef __KLIBC__ 64 #define INCL_DOS 65 #include <os2.h> 61 66 #endif 62 67 … … 351 356 return Path(std::string(link_path)); 352 357 } 358 #elif defined(__KLIBC__) 359 static CHAR Buff[2*_MAX_PATH]; 360 PPIB pib; 361 // get executable fullpath 362 DosGetInfoBlocks( NULL, &pib); 363 DosQueryModuleName( pib->pib_hmte, sizeof(Buff), Buff); 364 return Path(std::string(Buff)); 353 365 #elif defined(__FreeBSD__) 354 366 char exe_path[PATH_MAX]; -
TabularUnified clamav/trunk/libclamav/c++/llvm/lib/System/Unix/Process.inc ¶
r189 r191 214 214 unsigned Columns = 0; 215 215 216 #ifdef __KLIBC__ 217 { 218 int screendata[2]; 219 _scrsize(screendata); 220 Columns = screendata[0]; 221 } 222 #else 223 216 224 #if defined(HAVE_SYS_IOCTL_H) && defined(HAVE_TERMIOS_H) 217 225 // Try to determine the width of the terminal. … … 220 228 Columns = ws.ws_col; 221 229 #endif 230 231 #endif // __KLIBC__ 222 232 223 233 return Columns; -
TabularUnified clamav/trunk/libclamav/chmunpack.c ¶
r189 r191 572 572 lzx_free(stream); 573 573 574 #if ndef _WIN32574 #if !defined(_WIN32) && !defined(C_OS2) 575 575 /* Delete the file */ 576 576 if(cli_unlink(filename)) … … 583 583 if ((retval == -1) && (tmpfd >= 0)) { 584 584 close(tmpfd); 585 #if defined(_WIN32) || defined(C_OS2) 586 /* Now delete the file */ 587 cli_unlink(filename); 588 #endif 585 589 } 586 590 return retval; -
TabularUnified clamav/trunk/libclamav/fmap.c ¶
r189 r191 49 49 static inline unsigned int fmap_which_page(fmap_t *m, size_t at); 50 50 51 #if ndef _WIN3251 #if !defined(_WIN32) && !defined(C_OS2) 52 52 /* vvvvv POSIX STUFF BELOW vvvvv */ 53 53 … … 545 545 pages = fmap_align_items(len, pgsz); 546 546 hdrsz = fmap_align_to(sizeof(fmap_t), pgsz); 547 mapsz = pages * pgsz + hdrsz; 547 548 548 549 if(!(m = (fmap_t *)cli_malloc(sizeof(fmap_t)))) { … … 550 551 return NULL; 551 552 } 553 554 #ifdef _WIN32 552 555 if((m->fh = (HANDLE)_get_osfhandle(fd)) == INVALID_HANDLE_VALUE) { 553 556 cli_errmsg("fmap: cannot get a valid handle for descriptor %d\n", fd); … … 566 569 return NULL; 567 570 } 571 #else 572 m->data = mmap(0, len, PROT_READ, MAP_PRIVATE, fd, 0); 573 if (m == MAP_FAILED) { 574 cli_errmsg("fmap: cannot map file descriptor %d\n", fd); 575 free(m); 576 return NULL; 577 } 578 #endif 568 579 m->fd = fd; 569 580 m->dumb = dumb; … … 580 591 581 592 void funmap(fmap_t *m) { /* WIN32 */ 593 #ifdef _WIN32 582 594 UnmapViewOfFile(m->data); 583 595 CloseHandle(m->mh); 596 #else 597 munmap(m->data, 0); 598 #endif 584 599 free((void *)m); 585 600 } -
TabularUnified clamav/trunk/libclamav/fmap.h ¶
r189 r191 45 45 void *data; 46 46 #endif 47 #ifdef C_OS2 48 void *data; 49 #endif 47 50 uint32_t placeholder_for_bitmap; 48 51 } fmap_t; -
TabularUnified clamav/trunk/libclamav/mpool.c ¶
r189 r191 40 40 #endif 41 41 #include <stddef.h> 42 43 #if defined(C_OS2) 44 #define INCL_DOS 45 #define INCL_DOSERRORS 46 #include <os2.h> 47 #endif 42 48 43 49 #include "others.h" … … 347 353 mp.u.mpm.usize = sizeof(struct MPMAP); 348 354 mp.u.mpm.size = sz - sizeof(mp); 349 #ifndef _WIN32 355 #if defined(C_OS2) 356 if(DosAllocMem(&mpool_p, sz, PAG_READ|PAG_WRITE|PAG_COMMIT|OBJ_ANY) != NO_ERROR) 357 if(DosAllocMem(&mpool_p, sz, PAG_READ|PAG_WRITE|PAG_COMMIT) != NO_ERROR) 358 #elif !defined(_WIN32) 350 359 if ((mpool_p = (struct MP *)mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_PRIVATE|ANONYMOUS_MAP, -1, 0)) == MAP_FAILED) 351 360 #else … … 379 388 memset(mpm, FREEPOISON, mpmsize); 380 389 #endif 381 #ifndef _WIN32 390 #if defined(C_OS2) 391 DosFreeMem(mpm); 392 #elif !defined(_WIN32) 382 393 munmap((void *)mpm, mpmsize); 383 394 #else … … 389 400 memset(mp, FREEPOISON, mpmsize + sizeof(*mp)); 390 401 #endif 391 #ifndef _WIN32 402 #if defined(C_OS2) 403 DosFreeMem(mpm); 404 #elif !defined(_WIN32) 392 405 munmap((void *)mp, mpmsize + sizeof(*mp)); 393 406 #else … … 412 425 memset((char *)mpm + mused, FREEPOISON, mpm->size - mused); 413 426 #endif 414 #ifndef _WIN32 427 #if defined(C_OS2) 428 DosSetMem(mpm + mused, mpm->size - mused, PAG_DECOMMIT); 429 #elif !defined(_WIN32) 415 430 munmap((char *)mpm + mused, mpm->size - mused); 416 431 #else … … 427 442 memset((char *)mp + mused, FREEPOISON, mp->u.mpm.size + sizeof(*mp) - mused); 428 443 #endif 429 #ifndef _WIN32 444 #if defined(C_OS2) 445 DosSetMem(mp + mused, mp->u.mpm.size + sizeof(*mp) - mused, PAG_DECOMMIT); 446 #elif !defined(_WIN32) 430 447 munmap((char *)mp + mused, mp->u.mpm.size + sizeof(*mp) - mused); 431 448 #else … … 545 562 i = align_to_pagesize(mp, MIN_FRAGSIZE); 546 563 547 #ifndef _WIN32 564 #if defined(C_OS2) 565 if(DosAllocMem(&mpm, i, PAG_READ|PAG_WRITE|PAG_COMMIT|OBJ_ANY) != NO_ERROR) 566 if(DosAllocMem(&mpm, i, PAG_READ|PAG_WRITE|PAG_COMMIT) != NO_ERROR) { 567 #elif !defined(_WIN32) 548 568 if ((mpm = (struct MPMAP *)mmap(NULL, i, PROT_READ | PROT_WRITE, MAP_PRIVATE|ANONYMOUS_MAP, -1, 0)) == MAP_FAILED) { 549 569 #else -
TabularUnified clamav/trunk/libclamav/others.c ¶
r189 r191 70 70 #include "bytecode_api_impl.h" 71 71 72 #ifndef C_OS2 72 73 int (*cli_unrar_open)(int fd, const char *dirname, unrar_state_t *state); 73 74 int (*cli_unrar_extract_next_prepare)(unrar_state_t *state, const char *dirname); 74 75 int (*cli_unrar_extract_next)(unrar_state_t *state, const char *dirname); 75 76 void (*cli_unrar_close)(unrar_state_t *state); 77 #endif 78 76 79 int have_rar = 0; 77 80 static int is_rar_initd = 0; … … 165 168 is_rar_initd = 1; 166 169 170 #ifndef C_OS2 167 171 rhandle = lt_dlfind("libclamunrar_iface", "unrar"); 168 172 if (!rhandle) … … 178 182 return; 179 183 } 184 #endif // C_OS2 185 180 186 have_rar = 1; 181 187 } … … 739 745 } 740 746 741 #if def C_WINDOWS747 #if defined(C_WINDOWS) || defined(C_OS2) 742 748 /* 743 749 * Windows doesn't allow you to delete a directory while it is still open -
TabularUnified clamav/trunk/libclamav/others.h ¶
r189 r191 34 34 #include <stdio.h> 35 35 #include <stdlib.h> 36 #ifdef __KLIBC__ 37 #include <unistd.h> 38 #endif 36 39 #include "cltypes.h" 37 40 … … 286 289 }; 287 290 291 #ifndef __KLIBC__ 288 292 extern int (*cli_unrar_open)(int fd, const char *dirname, unrar_state_t *state); 289 293 extern int (*cli_unrar_extract_next_prepare)(unrar_state_t *state, const char *dirname); 290 294 extern int (*cli_unrar_extract_next)(unrar_state_t *state, const char *dirname); 291 295 extern void (*cli_unrar_close)(unrar_state_t *state); 296 #endif 292 297 extern int have_rar; 293 298 -
TabularUnified clamav/trunk/libclamav/others_common.c ¶
r189 r191 115 115 regex_t reg; 116 116 int match, flags = REG_EXTENDED | REG_NOSUB; 117 #if def _WIN32117 #if defined(_WIN32) || defined(C_OS2) 118 118 flags |= REG_ICASE; 119 119 #endif … … 306 306 } 307 307 308 309 #ifdef __KLIBC__ 310 // it seems that mmap exception handler does not work inside kernel functions, 311 // so we temporary trigger page faults before invoking write() 312 static int _writen( char* buff, unsigned int count) 313 { 314 int i; 315 char ch0 = buff[0]; 316 // the last byte can be on a different page 317 buff[0] = buff[count-1]; 318 for( i=0; i<count; i+=4096) 319 buff[0] = buff[i]; 320 // I need this to fake optimizer, otherwise loop will be removed with -O3 321 buff[0] = ch0; 322 return ch0; 323 } 324 #endif // __KLIBC__ 325 308 326 /* Function: writen 309 327 Try hard to write the specified number of bytes … … 318 336 todo = count; 319 337 current = (const unsigned char *) buff; 338 339 #ifdef __KLIBC__ 340 // it seems that mmap exception handler does not work inside kernel functions, 341 // so we temporary trigger page faults before invoking write() 342 retval = _writen( current, count); 343 #endif 320 344 321 345 do { … … 382 406 const char *tmpdir; 383 407 if( 384 #if def _WIN32408 #if defined(_WIN32) || defined(C_OS2) 385 409 !(tmpdir = getenv("TEMP")) && !(tmpdir = getenv("TMP")) 386 410 #else -
TabularUnified clamav/trunk/libclamav/readdb.c ¶
r189 r191 2703 2703 } 2704 2704 2705 const char *cl_retcfgdir(void) 2706 { 2707 return CONFDIR; 2708 } 2709 2705 2710 int cl_statinidir(const char *dirname, struct cl_stat *dbstat) 2706 2711 { -
TabularUnified clamav/trunk/libclamunrar_iface/unrar_iface.h ¶
r189 r191 25 25 #endif 26 26 27 #ifdef __KLIBC__ 28 #define unrar_open cli_unrar_open 29 #define unrar_extract_next_prepare cli_unrar_extract_next_prepare 30 #define unrar_extract_next cli_unrar_extract_next 31 #define unrar_close cli_unrar_close 32 #else 27 33 #define unrar_open libclamunrar_iface_LTX_unrar_open 28 34 #define unrar_extract_next_prepare libclamunrar_iface_LTX_unrar_extract_next_prepare 29 35 #define unrar_extract_next libclamunrar_iface_LTX_unrar_extract_next 30 36 #define unrar_close libclamunrar_iface_LTX_unrar_close 37 #endif 31 38 32 39 #ifndef HAVE_ATTRIB_PACKED -
TabularUnified clamav/trunk/libltdl/loaders/loadlibrary.c ¶
r189 r191 32 32 #include "lt__private.h" 33 33 #include "lt_dlloader.h" 34 35 #ifndef __KLIBC__ 34 36 35 37 #if defined(__CYGWIN__) … … 250 252 return address; 251 253 } 254 255 #endif // __KLIBC__ -
TabularUnified clamav/trunk/libltdl/ltdl.c ¶
r189 r191 233 233 /* Now open all the preloaded module loaders, so the application 234 234 can use _them_ to lt_dlopen its own modules. */ 235 #ifndef __KLIBC__ 235 236 #ifdef HAVE_LIBDLLOADER 236 237 if (!errors) … … 244 245 } 245 246 #endif /* HAVE_LIBDLLOADER */ 247 #endif // __KLIBC__ 246 248 } 247 249 -
TabularUnified clamav/trunk/shared/misc.c ¶
r189 r191 250 250 int daemonize(void) 251 251 { 252 #ifdef _WIN32 252 #if defined(C_OS2) 253 return 0; 254 #elif defined(_WIN32) 253 255 fputs("Background mode is not supported on your operating system\n", stderr); 254 256 return -1; … … 301 303 int match, flags = REG_EXTENDED | REG_NOSUB; 302 304 char fname[513]; 303 #if def _WIN32305 #if defined(_WIN32) || defined(C_OS2) 304 306 flags |= REG_ICASE; /* case insensitive on Windows */ 305 307 #endif … … 345 347 346 348 int cli_is_abspath(const char *path) { 347 #if def _WIN32349 #if defined(_WIN32) || defined(C_OS2) 348 350 int len = strlen(path); 349 return (len > 2 && path[0] == '\\' && path[1] == '\\') || (len >= 2 && ((*path >= 'a' && *path <= 'z') || (*path >= 'A' && *path <= 'Z')) && path[1] == ':'); 351 return (len > 2 && path[0] == '\\' && path[1] == '\\') 352 #ifdef C_OS2 353 || *path == '/' || *path == '\\' 354 #endif 355 || (len >= 2 && ((*path >= 'a' && *path <= 'z') || (*path >= 'A' && *path <= 'Z')) && path[1] == ':'); 350 356 #else 351 357 return *path == '/'; -
TabularUnified clamav/trunk/shared/optparser.c ¶
r189 r191 788 788 for(i = 0; i < (int) strlen(pt) - 1 && (pt[i] == ' ' || pt[i] == '\t'); i++); 789 789 pt += i; 790 for(i = strlen(pt); i >= 1 && (pt[i - 1] == ' ' || pt[i - 1] == '\t' || pt[i - 1] == '\n' ); i--);790 for(i = strlen(pt); i >= 1 && (pt[i - 1] == ' ' || pt[i - 1] == '\t' || pt[i - 1] == '\n' || pt[i - 1] == '\r'); i--); 791 791 if(!i) { 792 792 if(verbose) -
TabularUnified clamav/trunk/unit_tests/check_clamd.c ¶
r189 r191 51 51 #include "libclamav/cltypes.h" 52 52 53 #ifdef __KLIBC__ 54 #define SHUT_WR 0 55 #endif 56 53 57 #ifdef CHECK_HAVE_LOOPS 54 58 55 59 static int sockd; 56 #define SOCKET " clamd-test.socket"60 #define SOCKET "\\socket\\clamd-test.socket" 57 61 static void conn_setup_mayfail(int may) 58 62 { … … 398 402 static int sendmsg_fd(int sockd, const char *mesg, size_t msg_len, int fd, int singlemsg) 399 403 { 404 #ifndef __KLIBC__ 400 405 struct msghdr msg; 401 406 struct cmsghdr *cmsg; … … 438 443 439 444 return sendmsg(sockd, &msg, 0); 445 #endif // __KLIBC__ 440 446 } 441 447
Note:
See TracChangeset
for help on using the changeset viewer.