merge win32 patches from NJH

git-svn: trunk@2875
remotes/push_mirror/metadata
Tomasz Kojm 19 years ago
parent 8ca8a18e2d
commit ace24e1fbc
  1. 4
      ChangeLog
  2. 2
      shared/cdiff.c
  3. 2
      shared/getopt.c
  4. 4
      shared/network.c
  5. 5
      shared/network.h
  6. 15
      shared/output.c

@ -1,3 +1,7 @@
Wed Feb 28 02:17:39 CET 2007 (tk)
---------------------------------
* shared: merge win32 patches from NJH
Wed Feb 28 01:48:27 CET 2007 (tk)
---------------------------------
* drop shared/memory.[ch]

@ -27,7 +27,9 @@
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "shared/misc.h"
#include "shared/output.h"

@ -41,7 +41,9 @@
#include <stdio.h>
#ifndef C_WINDOWS
int strncmp(const char *s1, const char *s2, size_t n);
#endif
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C

@ -33,11 +33,11 @@
#include <string.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifndef C_WINDOWS
#ifndef C_WINDOWS
#include <netdb.h>
#endif

@ -21,8 +21,13 @@
#ifndef __NETWORK_H
#define __NETWORK_H
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifndef C_WINDOWS
#include <netdb.h>
#endif
int r_gethostbyname(const char *hostname, struct hostent *hp, char *buf, size_t len);

@ -16,6 +16,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#ifdef _MSC_VER
#include <windows.h>
#include <winsock.h>
#endif
#if HAVE_CONFIG_H
#include "clamav-config.h"
@ -26,13 +31,17 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <fcntl.h>
#include <time.h>
#include <sys/stat.h>
#include <errno.h>
#ifndef C_WINDOWS
#include <sys/time.h>
#include <sys/socket.h>
#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@ -121,7 +130,9 @@ void logg_close(void) {
int logg(const char *str, ...)
{
va_list args, argscpy, argsout;
#ifdef F_WRLCK
struct flock fl;
#endif
char *pt, *timestr, vbuff[1025];
time_t currtime;
struct stat sb;
@ -139,7 +150,7 @@ int logg(const char *str, ...)
if(logg_file) {
if(!logg_fd) {
old_umask = umask(0037);
if((logg_fd = fopen(logg_file, "a")) == NULL) {
if((logg_fd = fopen(logg_file, "at")) == NULL) {
umask(old_umask);
#ifdef CL_THREAD_SAFE
pthread_mutex_unlock(&logg_mutex);
@ -148,6 +159,7 @@ int logg(const char *str, ...)
return -1;
} else umask(old_umask);
#ifdef F_WRLCK
if(logg_lock) {
memset(&fl, 0, sizeof(fl));
fl.l_type = F_WRLCK;
@ -158,6 +170,7 @@ int logg(const char *str, ...)
return -1;
}
}
#endif
}
if(logg_size) {

Loading…
Cancel
Save