[Spread-cvs] cvs commit: spread/daemon configuration.c arch.h
jonathan at spread.org
jonathan at spread.org
Fri Sep 20 17:14:52 EDT 2002
jonathan 02/09/20 21:14:51
Modified: daemon configuration.c arch.h
Log:
Fixes for Windows compilation.
Revision Changes Path
1.6 +7 -2 spread/daemon/configuration.c
Index: configuration.c
===================================================================
RCS file: /storage/cvsroot/spread/daemon/configuration.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- configuration.c 17 Sep 2002 04:41:01 -0000 1.5
+++ configuration.c 20 Sep 2002 21:14:51 -0000 1.6
@@ -106,6 +106,7 @@
char machine_name[256];
char ip[16];
int s,i,j;
+ char configfile_location[MAXPATHLEN];
#if 0
char line[132];
char buf[132];
@@ -120,14 +121,18 @@
/* init Config, Config_procs from file
init My from host
*/
+ configfile_location[0] = '\0';
+ strcat(configfile_location, SPREAD_ETCDIR);
+ strcat(configfile_location, "/spread.conf");
+
if (NULL != (yyin = fopen(file_name,"r")) )
Alarm( PRINT, "Conf_init: using file: %s\n", file_name);
if (yyin == NULL)
if (NULL != (yyin = fopen("./spread.conf", "r")) )
Alarm( PRINT, "Conf_init: using file: ./spread.conf\n");
if (yyin == NULL)
- if (NULL != (yyin = fopen(SPREAD_ETCDIR "/spread.conf", "r")) )
- Alarm( PRINT, "Conf_init: using file: " SPREAD_ETCDIR "/spread.conf\n");
+ if (NULL != (yyin = fopen(configfile_location, "r")) )
+ Alarm( PRINT, "Conf_init: using file: %s\n", configfile_location);
if (yyin == NULL)
Alarm( EXIT, "Conf_init: error opening config file %s\n",
file_name);
1.11 +39 -8 spread/daemon/arch.h
Index: arch.h
===================================================================
RCS file: /storage/cvsroot/spread/daemon/arch.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- arch.h 16 Sep 2002 16:59:06 -0000 1.10
+++ arch.h 20 Sep 2002 21:14:51 -0000 1.11
@@ -33,8 +33,6 @@
#ifndef INC_ARCH
#define INC_ARCH
-#include "config.h"
-
/*
* Each record in this file represents an architecture.
* Each record contains the following fields:
@@ -61,6 +59,10 @@
#ifndef ARCH_PC_WIN95
/* If we aren't using windows... we can use autoconf */
+
+#include "config.h"
+
+
#ifdef WORDS_BIGENDIAN
#define ARCH_ENDIAN 0x00000000
#else
@@ -86,12 +88,6 @@
#define RAND_MAX 2147483647
#endif
-#ifdef HAVE_LRAND48
-#define get_rand lrand48
-#else
-#define get_rand rand
-#endif
-
#define sock_errno errno
#define sock_strerror strerror
#define sock_set_errno(a) (errno = (a))
@@ -140,6 +136,8 @@
* can be raised by defining a larger constant before including windows.h winsock.h
*/
#define FD_SETSIZE 1024
+/* System location of spread.conf file */
+#define SPREAD_ETCDIR /etc
/* Use winsock constants since we are dealing with sockets
* Note: If we ever need file IO with errno's we will have conflicts
* since the WSA version and the basic E versions may not have the same
@@ -153,7 +151,40 @@
#define EINTR WSAEINTR
#define EAGAIN WSAEWOULDBLOCK
+#ifndef int16
+#define int16 short
+#endif
+
+#ifndef int16u
+#define int16u unsigned short
+#endif
+
+#ifndef int32
+#define int32 int
+#endif
+
+#ifndef int32u
+#define int32u unsigned int
+#endif
+
+#ifndef UINT32_MAX
+#define UINT32_MAX UINT_MAX
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX INT_MAX
+#endif
+
+
#endif /* ARCH_PC_WIN95 */
+
+/* Pick which rand version to use */
+#ifdef HAVE_LRAND48
+#define get_rand lrand48
+#else
+#define get_rand rand
+#endif
+
+
#define ENDIAN_TYPE 0x80000080
More information about the Spread-cvs
mailing list