[Spread-cvs] commit: r633 - in trunk: daemon libspread-util/src
jschultz at spread.org
jschultz at spread.org
Thu Jan 9 16:11:38 EST 2014
Author: jschultz
Date: 2014-01-09 16:11:37 -0500 (Thu, 09 Jan 2014)
New Revision: 633
Modified:
trunk/daemon/arch.h
trunk/daemon/protocol.c
trunk/daemon/scatter.h
trunk/daemon/spread.c
trunk/libspread-util/src/alarm.c
trunk/libspread-util/src/data_link.c
Log:
Fixes for win32 build
Modified: trunk/daemon/arch.h
===================================================================
--- trunk/daemon/arch.h 2014-01-06 20:07:22 UTC (rev 632)
+++ trunk/daemon/arch.h 2014-01-09 21:11:37 UTC (rev 633)
@@ -177,28 +177,27 @@
*/
#ifndef int16
-#define int16 short
-char *soch_strerror(int err); /* forward declare this func from the arch.c file (win32 only) */
-
+# define int16 short
#endif
#ifndef int16u
-#define int16u unsigned short
+# define int16u unsigned short
#endif
#ifndef int32
-#define int32 int
+# define int32 int
#endif
#ifndef int32u
-#define int32u unsigned int
+# define int32u unsigned int
#endif
#ifndef UINT32_MAX
-#define UINT32_MAX UINT_MAX
+# define UINT32_MAX UINT_MAX
#endif
+
#ifndef INT32_MAX
-#define INT32_MAX INT_MAX
+# define INT32_MAX INT_MAX
#endif
/* Declare functions from arch.c */
Modified: trunk/daemon/protocol.c
===================================================================
--- trunk/daemon/protocol.c 2014-01-06 20:07:22 UTC (rev 632)
+++ trunk/daemon/protocol.c 2014-01-09 21:11:37 UTC (rev 633)
@@ -1102,7 +1102,7 @@
down_link *tmp_down;
/* last packet in message */
- frag_ptr->fragment_index = -scat_ptr->num_elements;
+ frag_ptr->fragment_index = -(int16) scat_ptr->num_elements;
tmp_down = Down_queue_ptr->first;
Down_queue_ptr->first = Down_queue_ptr->first->next;
Modified: trunk/daemon/scatter.h
===================================================================
--- trunk/daemon/scatter.h 2014-01-06 20:07:22 UTC (rev 632)
+++ trunk/daemon/scatter.h 2014-01-09 21:11:37 UTC (rev 633)
@@ -36,7 +36,9 @@
#ifndef INC_SCATTER
#define INC_SCATTER
+#include <stddef.h>
#include "arch.h"
+
#define MAX_SCATTER_ELEMENTS 100
/* scat_element is EXACTLY as defined in iovec */
Modified: trunk/daemon/spread.c
===================================================================
--- trunk/daemon/spread.c 2014-01-06 20:07:22 UTC (rev 632)
+++ trunk/daemon/spread.c 2014-01-09 21:11:37 UTC (rev 633)
@@ -62,7 +62,7 @@
static char *My_name;
static char My_name_buf[80];
-static char Config_file[80];
+static char Config_file[512];
static int Log;
static const char Spread_build_date[] = SPREAD_BUILD_DATE;
@@ -260,6 +260,9 @@
}else if( !strncmp( *argv, "-c", 2 ) ){
if (argc < 2) Print_help();
+ if (strlen(argv[1]) >= sizeof(Config_file)) {
+ Alarmp(SPLOG_FATAL, SYSTEM, "Usage: config file name too long\n", argv[1]);
+ }
strcpy( Config_file, argv[1] );
argc--; argv++;
Modified: trunk/libspread-util/src/alarm.c
===================================================================
--- trunk/libspread-util/src/alarm.c 2014-01-06 20:07:22 UTC (rev 632)
+++ trunk/libspread-util/src/alarm.c 2014-01-09 21:11:37 UTC (rev 633)
@@ -47,7 +47,7 @@
# undef EINPROGRESS
# undef EALREADY
# ifndef va_copy
-# define va_copy(d,s) (d) = (s)
+# define va_copy(d,s) ((d) = (s))
# endif
#endif
#include <errno.h>
Modified: trunk/libspread-util/src/data_link.c
===================================================================
--- trunk/libspread-util/src/data_link.c 2014-01-06 20:07:22 UTC (rev 632)
+++ trunk/libspread-util/src/data_link.c 2014-01-09 21:11:37 UTC (rev 633)
@@ -353,7 +353,7 @@
total_len = MAX_PACKET_SIZE;
sa_len = sizeof(source_address);
- ret = recvfrom( chan, pseudo_scat, total_len, 0, &source_address, &sa_len);
+ ret = recvfrom( chan, pseudo_scat, total_len, 0, (struct sockaddr *) &source_address, &sa_len);
for( i=0, total_len = ret, start =0; total_len > 0; i++)
{
More information about the Spread-cvs
mailing list