projects
/
citadel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed the logging facility from citserver, use syslog instead
[citadel.git]
/
citadel
/
clientsocket.c
diff --git
a/citadel/clientsocket.c
b/citadel/clientsocket.c
index 49cfd54ef7c68fa03b590aad4347549e13213ea5..e4044d630c9d892b63a44104e7b43c07f0908391 100644
(file)
--- a/
citadel/clientsocket.c
+++ b/
citadel/clientsocket.c
@@
-4,7
+4,7
@@
* sockets for the Citadel client; for that you must look in ipc_c_tcp.c
* (which, uncoincidentally, bears a striking similarity to this file).
*
* sockets for the Citadel client; for that you must look in ipc_c_tcp.c
* (which, uncoincidentally, bears a striking similarity to this file).
*
- * Copyright (c) 1987-201
0
by the citadel.org team
+ * Copyright (c) 1987-201
1
by the citadel.org team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-36,6
+36,7
@@
#include <pwd.h>
#include <errno.h>
#include <stdarg.h>
#include <pwd.h>
#include <errno.h>
#include <stdarg.h>
+#include <syslog.h>
#include <libcitadel.h>
#include "citadel.h"
#include "server.h"
#include <libcitadel.h>
#include "citadel.h"
#include "server.h"
@@
-85,7
+86,7
@@
int sock_connect(char *host, char *service)
rc = getaddrinfo(host, service, &hints, &res);
if (rc != 0) {
rc = getaddrinfo(host, service, &hints, &res);
if (rc != 0) {
-
CtdlLogPrintf(CTDL
_ERR, "%s: %s\n", host, gai_strerror(rc));
+
syslog(LOG
_ERR, "%s: %s\n", host, gai_strerror(rc));
return(-1);
}
return(-1);
}
@@
-95,7
+96,7
@@
int sock_connect(char *host, char *service)
for (ai = res; ai != NULL; ai = ai->ai_next) {
sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
if (sock < 0) {
for (ai = res; ai != NULL; ai = ai->ai_next) {
sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
if (sock < 0) {
-
CtdlLogPrintf(CTDL
_ERR, "socket() failed: %s\n", strerror(errno));
+
syslog(LOG
_ERR, "socket() failed: %s\n", strerror(errno));
freeaddrinfo(res);
return(-1);
}
freeaddrinfo(res);
return(-1);
}
@@
-105,7
+106,7
@@
int sock_connect(char *host, char *service)
return(sock);
}
else {
return(sock);
}
else {
-
CtdlLogPrintf(CTDL
_ERR, "connect() failed: %s\n", strerror(errno));
+
syslog(LOG
_ERR, "connect() failed: %s\n", strerror(errno));
close(sock);
}
}
close(sock);
}
}
@@
-140,7
+141,7
@@
int socket_read_blob(int *Socket, StrBuf * Target, int bytes, int timeout)
&CCC->SBuf.ReadWritePointer,
Socket, 1, bytes, O_TERM, &Error);
if (retval < 0) {
&CCC->SBuf.ReadWritePointer,
Socket, 1, bytes, O_TERM, &Error);
if (retval < 0) {
-
CtdlLogPrintf(CTDL
_CRIT,
+
syslog(LOG
_CRIT,
"%s failed: %s\n", __FUNCTION__, Error);
}
return retval;
"%s failed: %s\n", __FUNCTION__, Error);
}
return retval;
@@
-159,7
+160,7
@@
int CtdlSockGetLine(int *sock, StrBuf * Target, int nSec)
&CCC->SBuf.ReadWritePointer,
sock, nSec, 1, &Error);
if ((rc < 0) && (Error != NULL))
&CCC->SBuf.ReadWritePointer,
sock, nSec, 1, &Error);
if ((rc < 0) && (Error != NULL))
-
CtdlLogPrintf(CTDL
_CRIT,
+
syslog(LOG
_CRIT,
"%s failed: %s\n", __FUNCTION__, Error);
return rc;
}
"%s failed: %s\n", __FUNCTION__, Error);
return rc;
}