fix some compiler warnings

git-svn-id: file:///var/lib/svn/clamav-devel/branches/clamd-proto@4745 77e5149b-7576-45b1-b177-96237e5ba77b
0.95
Török Edvin 17 years ago
parent 95f258668c
commit 10ab5e32f4
  1. 5
      ChangeLog
  2. 2
      clamd/scanner.c
  3. 9
      clamd/server-th.c
  4. 5
      clamd/session.c
  5. 4
      clamd/thrmgr.c

@ -1,3 +1,8 @@
Thu Feb 12 12:25:25 EET 2009 (edwin)
------------------------------------
* clamd/scanner.c, clamd/server-th.c, clamd/session.c,
clamd/thrmgr.c: fix some compiler warnings
Thu Feb 12 12:20:05 EET 2009 (edwin)
------------------------------------
* unit_tests/valgrind.supp: add some more suppressions

@ -331,7 +331,7 @@ int scanstream(int odesc, unsigned long int *scanned, const struct cl_engine *en
if (!retval || retval == -1) {
const char *reason = !retval ? "timeout" : "poll";
mdprintf(odesc, "Accept %s. ERROR%c", reason, term);
logg("!ScanStream %u: accept %s.\n", reason, port);
logg("!ScanStream %u: accept %s.\n", port, reason);
closesocket(sockfd);
return -1;
}

@ -838,7 +838,7 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi
int has_more = (buf->buffer + buf->off) > (cmd + cmdlen);
enum commands cmdtype = parse_command(cmd, &argument);
logg("*RECVTH: got command %s (%u, %u), argument: %s\n",
cmd, cmdlen, cmdtype, argument ? argument : "");
cmd, (unsigned)cmdlen, (unsigned)cmdtype, argument ? argument : "");
if (cmdtype == COMMAND_FILDES) {
if (buf->buffer + buf->off <= cmd + strlen("FILDES\n")) {
/* we need the extra byte from recvmsg */
@ -928,7 +928,7 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi
} else
buf->off = 0;
if (buf->off)
logg("*RECVTH: moved partial command: %u\n", buf->off);
logg("*RECVTH: moved partial command: %lu\n", (unsigned long)buf->off);
else
logg("*RECVTH: consumed entire command\n");
}
@ -936,7 +936,7 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi
break;
if (!error && buf->mode == MODE_WAITREPLY && buf->off) {
/* Client is not supposed to send anything more */
logg("^Client sent garbage after last command: %u bytes\n", buf->off);
logg("^Client sent garbage after last command: %lu bytes\n", (unsigned long)buf->off);
buf->buffer[buf->off] = '\0';
logg("*RECVTH: garbage: %s\n", buf->buffer);
error = 1;
@ -974,7 +974,8 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi
}
}
if (buf->chunksize > buf->quota) {
logg("^INSTREAM: Size limit reached, (requested: %lu, max: %lu)\n", buf->chunksize, buf->quota);
logg("^INSTREAM: Size limit reached, (requested: %lu, max: %lu)\n",
(unsigned long)buf->chunksize, (unsigned long)buf->quota);
conn_reply_error(&conn, "INSTREAM size limit exceeded. ERROR");
error = 1;
} else {

@ -277,7 +277,10 @@ int command(client_conn_t *conn, int *virus)
ret = -1;
} else
ret = 0;
ftruncate(conn->scanfd, 0);
if (ftruncate(conn->scanfd, 0) == -1) {
/* not serious, we're going to close it and unlink it anyway */
logg("*ftruncate failed: %d\n", errno);
}
close(conn->scanfd);
conn->scanfd = -1;
cli_unlink(conn->filename);

@ -801,8 +801,10 @@ void thrmgr_group_waitforall(jobgroup_t *group, unsigned *ok, unsigned *error, u
#define JOBGROUP_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 1, 0, 0, 0, 0 };
jobgroup_t *thrmgr_group_new(void)
{
jobgroup_t *group;
jobgroup_t dummy = JOBGROUP_INITIALIZER;
jobgroup_t *group = malloc(sizeof(*group));
group = malloc(sizeof(*group));
if (!group)
return NULL;
memcpy(group, &dummy, sizeof(dummy));

Loading…
Cancel
Save