bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch for cfengine-1.6.0 and vendor compilers


From: Iain Morgan
Subject: Patch for cfengine-1.6.0 and vendor compilers
Date: Fri, 15 Dec 2000 16:31:00 -0800 (PST)

Compiling cfengine-1.6.0 with either the MIPSpro compiler (7.3.1.1m) or 
IRIX or the SUNWspro compiler (4.2) on Solaris 2.6 fails due to errors with
edittools.c.  However, the code compiles fine with gcc.

The errors are due to incorrect casting and are fixed by this patch.

diff -u cfengine-1.6.0/src/edittools.c cfengine-1.6.0/src/edittools.c.patched
--- cfengine-1.6.0/src/edittools.c      Thu Nov 30 22:30:58 2000
+++ cfengine-1.6.0/src/edittools.c.patched      Thu Dec 14 23:10:52 2000
@@ -1671,7 +1671,7 @@
 { int sd,n_read;
   char buf[bufsize];
   off_t n_read_total = 0;
-  void *ptr;
+  char *ptr;
 
 Debug("LoadBinaryFile(%s,%d)\n",source,size);
   
@@ -1796,7 +1796,7 @@
 
 for (sp = 0; sp < (off_t)(size-strlen(data)); sp++)
    {
-   if (bcmp(memseg+sp,data,strlen(data)) == 0)
+   if (bcmp((char *) memseg+sp,data,strlen(data)) == 0)
       {
       sprintf(OUTPUT,"WARNING! File %s contains literal string 
%.255s",filename,data);
       CfLog(cferror,OUTPUT,"");
@@ -1813,7 +1813,7 @@
    {
    bcopy(&rxcache,&rx,sizeof(rx)); /* To fix a bug on some implementations 
where rx gets emptied */
 
-   if (regexec(&rx,(char *)(sp+memseg),1,&pmatch,0) == 0)
+   if (regexec(&rx,(char *)memseg+sp,1,&pmatch,0) == 0)
       {
       sprintf(OUTPUT,"WARNING! File %s contains regular expression 
%.255s",filename,data);
       CfLog(cferror,OUTPUT,"");
@@ -1874,7 +1874,7 @@
  
 for (sp = 0; sp < (off_t)(size-statbuf.st_size); sp++)
    {
-   if (bcmp(memseg+sp,pattern,statbuf.st_size-1) == 0)
+   if (bcmp((char *) memseg+sp,pattern,statbuf.st_size-1) == 0)
       {
       sprintf(OUTPUT,"WARNING! File %s contains the contents of reference file 
%s",filename,data);
       CfLog(cferror,OUTPUT,"");

--
Iain Morgan
NAS Desktop Support Group



reply via email to

[Prev in Thread] Current Thread [Next in Thread]