use just mutex+strerror

git-svn: trunk@4935
0.95
Török Edvin 16 years ago
parent e4d9fb8e13
commit 05b0e635de
  1. 4
      ChangeLog
  2. 12
      libclamav/others_common.c

@ -1,3 +1,7 @@
Thu Mar 12 17:52:31 EET 2009 (edwin)
------------------------------------
* libclamav/others_common.c: use just mutex+strerror
Thu Mar 12 16:22:36 CET 2009 (tk)
---------------------------------
* libclamav, clamd, clamscan: replace cl_engine_(set|get) with

@ -23,10 +23,6 @@
#include "clamav-config.h"
#endif
#ifdef C_LINUX
#define _XOPEN_SOURCE 600
#endif
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
@ -692,12 +688,6 @@ static int cli_ftw_dir(const char *dirname, int flags, int maxdepth, cli_ftw_cb
* the XSI, and the GNU one, so provide a wrapper to make sure correct one is
* used */
const char* cli_strerror(int errnum, char *buf, size_t len)
{
#ifdef HAVE_STRERROR_R
if (strerror_r(errnum, buf, len) == -1)
return "strerror_r failed";
return buf;
#else
{
char *err;
pthread_mutex_lock(&cli_strerror_mutex);
@ -706,6 +696,4 @@ const char* cli_strerror(int errnum, char *buf, size_t len)
pthread_mutex_unlock(&cli_strerror_mutex);
return buf;
}
#endif
}

Loading…
Cancel
Save