applying patch proposed by Thomas Dreibholz for building on recent fedoras
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 19 Jun 2015 15:48:52 +0000 (17:48 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 19 Jun 2015 15:48:52 +0000 (17:48 +0200)
root-context/dcookie.c
root-context/fd_bind53.c
slice-context/src/vsys.c

index ca22353..d6600d0 100644 (file)
@@ -30,7 +30,7 @@ int main(int argc,char *argv[]) {
                                        printf("%s\n",path_buf);
                        }
                        else {
                                        printf("%s\n",path_buf);
                        }
                        else {
-                                       printf("% Not found\n");
+                                       printf("%% Not found\n");
                        }
                }
 }
                        }
                }
 }
index e5582bb..17867ae 100644 (file)
@@ -3,6 +3,7 @@
 #include <sys/socket.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <sys/socket.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 #include <errno.h>
 #include "fdpass.h"
 
 #include <errno.h>
 #include "fdpass.h"
 
index 186e47f..dbe8f14 100644 (file)
@@ -190,7 +190,7 @@ static int _fifo_push (const char *fifo_in, const char *fifo_out,
   }
 
   // send inputs to the fifo_in
   }
 
   // send inputs to the fifo_in
-  fprintf (in, input);
+  fprintf (in, "%s", input);
 
   // force flush and close the fifo_in so the program on the other side
   // can process input.
 
   // force flush and close the fifo_in so the program on the other side
   // can process input.
@@ -199,7 +199,7 @@ static int _fifo_push (const char *fifo_in, const char *fifo_out,
   nbytes = fread(msg, SIZE, 1, out);
  
   // the error buffer will not be empty if we read an error
   nbytes = fread(msg, SIZE, 1, out);
  
   // the error buffer will not be empty if we read an error
-  if (strcmp(msg, "") != 0){
+  if ((nbytes > 0) && (strcmp(msg, "") != 0)) {
       // an errror was read from the fifo_out ...
       return -3;
   }
       // an errror was read from the fifo_out ...
       return -3;
   }
@@ -281,7 +281,7 @@ int _fd_tuntap(int if_type, int no_pi, char *if_name) {
   vsys_sock = socket (AF_UNIX, SOCK_STREAM, 0);
 
   if (vsys_sock == -1){
   vsys_sock = socket (AF_UNIX, SOCK_STREAM, 0);
 
   if (vsys_sock == -1){
-    snprintf (if_name, SIZE, strerror(errno));
+    snprintf (if_name, SIZE, "%s", strerror(errno));
     return -2;
   }
 
     return -2;
   }
 
@@ -294,7 +294,7 @@ int _fd_tuntap(int if_type, int no_pi, char *if_name) {
     sizeof(struct sockaddr_un));
 
   if (ret == -1){
     sizeof(struct sockaddr_un));
 
   if (ret == -1){
-    snprintf (if_name, SIZE, strerror(errno));
+    snprintf (if_name, SIZE, "%s", strerror(errno));
     return -3;
   }
  
     return -3;
   }
  
@@ -321,7 +321,7 @@ int _fd_tuntap(int if_type, int no_pi, char *if_name) {
   ret = ioctl (fd, TUNGETIFF, (void *)&ifr);
   if (ret == -1){
     close (fd);
   ret = ioctl (fd, TUNGETIFF, (void *)&ifr);
   if (ret == -1){
     close (fd);
-    snprintf (if_name, SIZE, strerror(errno));
+    snprintf (if_name, SIZE, "%s", strerror(errno));
     return -6;
   }
   
     return -6;
   }
   
@@ -338,7 +338,7 @@ int _fd_tuntap(int if_type, int no_pi, char *if_name) {
   ret = ioctl (fd, TUNSETIFF, (void *)&ifr);
   if (ret == -1){
     close (fd);
   ret = ioctl (fd, TUNSETIFF, (void *)&ifr);
   if (ret == -1){
     close (fd);
-    snprintf (if_name, SIZE, strerror(errno));
+    snprintf (if_name, SIZE, "%s", strerror(errno));
     return -7;
   }
 */
     return -7;
   }
 */