Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion _include/mdsmsg.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include <stdio.h>
#include <time.h>
#include <string.h>

// To activate the MDSDBG() debug messages, uncomment the following line.
//#define DEBUG
//#undef DEBUG
#ifdef MDSDBG
Expand All @@ -27,7 +29,7 @@
#define __MDSMSGPREFIX(LV) ( \
{ \
pos = __FILE__; \
while (!strncmp(pos, "../", 3)) \
while (!strncmp(pos, "../", (unsigned long int) 3)) \
pos += 3; \
pos = msg + sprintf(msg, "%c, %u:%lu, %u.%09u: %s:%d ", \
LV, getpid(), CURRENT_THREAD_ID(), \
Expand Down
4 changes: 2 additions & 2 deletions mdstcpip/mdsipshr/MdsValue.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ EXPORT int MdsIpGetDescriptor(int id, const char *expression, int nargs,
strcat(newexp, ",__si($)");
strcat(newexp, "))");
nargs += 2;
MDSDBG(newexp);
MDSDBG("%s", newexp);
status = SendArg(id, 0, DTYPE_CSTRING, nargs, strlen(newexp), 0, &dim,
(char *)newexp);
free(newexp);
MDSDBG(expression);
MDSDBG("%s", expression);
struct descriptor_a *arr;
status = SendArg(id, 1, DTYPE_CSTRING, nargs, strlen(expression), 0, &dim,
(char *)expression);
Expand Down
3 changes: 2 additions & 1 deletion servershr/ServerSendMessage.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,14 @@ static void receiver_thread(void *sockptr)
FD_ZERO(&fdactive);
FD_SET(sock, &fdactive);
int rep;
int num = 0;
struct timeval readto, timeout = {10, 0};
for (rep = 0; rep < 10; rep++)
{
for (readfds = fdactive, readto = timeout;;
readfds = fdactive, readto = timeout, rep = 0)
{
int num = select(FD_SETSIZE, &readfds, NULL, NULL, &readto);
num = select(FD_SETSIZE, &readfds, NULL, NULL, &readto);
if (num < 0)
break;
if (num == 0)
Expand Down