LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File cfengine-2.1.11-strict-aliasing-fix.diff of Package cfengine (Project home:danci1973)

diff -Nur cfengine-2.1.9.orig/src/link.c cfengine-2.1.9.new/src/link.c
--- cfengine-2.1.9.orig/src/link.c	2004-04-17 16:11:06.000000000 +0200
+++ cfengine-2.1.9.new/src/link.c	2004-08-11 13:43:35.260900150 +0200
@@ -393,6 +393,10 @@
 { struct stat buf,savebuf;
   char to[CF_BUFSIZE],linkbuf[CF_BUFSIZE],saved[CF_BUFSIZE],absto[CF_BUFSIZE],*lastnode;
   struct UidList fakeuid;
+  union {
+         struct UidList *uifakeuid;
+         struct GidList *gifakeuid;
+  } ufakeuid = { &fakeuid };
   struct Image ip;
   char stamp[CF_BUFSIZE];
   time_t STAMPNOW;
@@ -435,7 +439,7 @@
    ip.plus = CF_SAMEMODE;
    ip.minus = CF_SAMEMODE;
    ip.uid = &fakeuid;
-   ip.gid = (struct GidList *) &fakeuid;
+   ip.gid = ufakeuid.gifakeuid;
    ip.action = "do";
    ip.recurse = 0;
    ip.type = 't';
@@ -858,11 +862,15 @@
 { struct stat frombuf,tobuf;
   char saved[CF_BUFSIZE], *lastnode;
   struct UidList fakeuid;
+  union {
+         struct UidList *uifakeuid;
+         struct GidList *gifakeuid;
+  } ufakeuid = { &fakeuid };
   struct Image ip;
   char stamp[CF_BUFSIZE];
   time_t STAMPNOW;
   STAMPNOW = time((time_t *)NULL);
-  
+
 for (lastnode = from+strlen(from); *lastnode != '/'; lastnode--)
    {
    }
@@ -888,7 +896,7 @@
    ip.plus = CF_SAMEMODE;
    ip.minus = CF_SAMEMODE;
    ip.uid = &fakeuid;
-   ip.gid = (struct GidList *) &fakeuid;
+   ip.gid = ufakeuid.gifakeuid;
    ip.action = "do";
    ip.recurse = 0;
    ip.type = 't';