#include "tools.h"
static const char *hello_string = "hi there\n";
+#ifndef HELLO_BUF_SZ
#define HELLO_BUF_SZ 32
+#endif
static char hello_buf[HELLO_BUF_SZ];
static int
return ipcCloseAllFD(prfd, pwfd, crfd, cwfd);
}
- memset(hello_buf, '\0', HELLO_BUF_SZ);
-
if (type == IPC_UDP_SOCKET)
- x = comm_udp_recv(prfd, hello_buf, HELLO_BUF_SZ - 1, 0);
+ x = comm_udp_recv(prfd, hello_buf, sizeof(hello_buf)-1, 0);
else
- x = read(prfd, hello_buf, HELLO_BUF_SZ - 1);
+ x = read(prfd, hello_buf, sizeof(hello_buf)-1);
+ if (x >= 0)
+ hello_buf[x+1] = '\0';
if (x < 0) {
debugs(54, DBG_CRITICAL, "ipcCreate: PARENT: hello read test failed");