projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
there were two lines of debug info printed by rrd_xport, messing up the xml code...
[rrdtool.git]
/
src
/
rrd_daemon.c
diff --git
a/src/rrd_daemon.c
b/src/rrd_daemon.c
index
68216cb
..
7a72b07
100644
(file)
--- a/
src/rrd_daemon.c
+++ b/
src/rrd_daemon.c
@@
-75,19
+75,24
@@
#include "rrd_client.h"
#include <stdlib.h>
#include "rrd_client.h"
#include <stdlib.h>
+
+#ifndef WIN32
#include <stdint.h>
#include <stdint.h>
-#include <stdio.h>
#include <unistd.h>
#include <unistd.h>
-#include <string.h>
#include <strings.h>
#include <strings.h>
-#include <stdint.h>
#include <inttypes.h>
#include <inttypes.h>
+# include <sys/socket.h>
+
+#else
+
+#endif
+#include <stdio.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
-#include <sys/socket.h>
#include <sys/un.h>
#include <netdb.h>
#include <poll.h>
#include <sys/un.h>
#include <netdb.h>
#include <poll.h>
@@
-461,7
+466,7
@@
static int add_response_info(listen_socket_t *sock, char *fmt, ...) /* {{{ */
va_start(argp, fmt);
#ifdef HAVE_VSNPRINTF
va_start(argp, fmt);
#ifdef HAVE_VSNPRINTF
- len = vsnprintf(buffer, sizeof(buffer)
-1
, fmt, argp);
+ len = vsnprintf(buffer, sizeof(buffer), fmt, argp);
#else
len = vsprintf(buffer, fmt, argp);
#endif
#else
len = vsprintf(buffer, fmt, argp);
#endif
@@
-519,7
+524,7
@@
static int send_response (listen_socket_t *sock, response_code rc,
rclen = sprintf(buffer, "%d ", lines);
va_start(argp, fmt);
#ifdef HAVE_VSNPRINTF
rclen = sprintf(buffer, "%d ", lines);
va_start(argp, fmt);
#ifdef HAVE_VSNPRINTF
- len = vsnprintf(buffer+rclen, sizeof(buffer)-rclen
-1
, fmt, argp);
+ len = vsnprintf(buffer+rclen, sizeof(buffer)-rclen, fmt, argp);
#else
len = vsprintf(buffer+rclen, fmt, argp);
#endif
#else
len = vsprintf(buffer+rclen, fmt, argp);
#endif
@@
-2154,7
+2159,7
@@
static int open_listen_socket_network(const listen_socket_t *sock) /* {{{ */
char *port;
int status;
char *port;
int status;
- strncpy (addr_copy, sock->addr, sizeof
(addr_copy)
);
+ strncpy (addr_copy, sock->addr, sizeof
(addr_copy)-1
);
addr_copy[sizeof (addr_copy) - 1] = 0;
addr = addr_copy;
addr_copy[sizeof (addr_copy) - 1] = 0;
addr = addr_copy;
@@
-2446,7
+2451,7
@@
static int daemonize (void) /* {{{ */
{
listen_socket_t sock;
memset(&sock, 0, sizeof(sock));
{
listen_socket_t sock;
memset(&sock, 0, sizeof(sock));
- strncpy(sock.addr, RRDCACHED_DEFAULT_ADDRESS, sizeof(sock.addr));
+ strncpy(sock.addr, RRDCACHED_DEFAULT_ADDRESS, sizeof(sock.addr)
-1
);
open_listen_socket (&sock);
}
open_listen_socket (&sock);
}