From cdd061e536ba6b0b503f1a7a7f36526f7760b67e Mon Sep 17 00:00:00 2001
From: an7s <an7s@git.zephyr-software.com>
Date: Thu, 5 Mar 2015 18:16:20 +0000
Subject: [PATCH] Added configuration for cinderella

---
 .gitattributes           | 1 +
 configure_for_cinderella | 4 ++++
 inferfn/infer.c          | 4 ++--
 3 files changed, 7 insertions(+), 2 deletions(-)
 create mode 100755 configure_for_cinderella

diff --git a/.gitattributes b/.gitattributes
index 7b7189f..763a7a1 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -3,6 +3,7 @@
 /configure -text
 /configure.in -text
 /configure_for_cgc -text
+/configure_for_cinderella -text
 example/Makefile.in -text
 example/callback.c -text
 inferfn/Makefile.in -text
diff --git a/configure_for_cinderella b/configure_for_cinderella
new file mode 100755
index 0000000..3c0815e
--- /dev/null
+++ b/configure_for_cinderella
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+# pickup the CGC syscalls
+./configure_for_cgc --enable-inferfn
diff --git a/inferfn/infer.c b/inferfn/infer.c
index 2eff3c8..9eade64 100644
--- a/inferfn/infer.c
+++ b/inferfn/infer.c
@@ -29,7 +29,7 @@ static void clear_response(struct response *res)
 
 static void send_response(const int fd, struct response *res)
 {
-	write(fd, res, sizeof(struct response));
+	cgc_transmit(fd, res, sizeof(struct response));
 }
 
 static void send_error_response(const int fd)
@@ -208,7 +208,7 @@ void commandLoop()
 
 	do {
 		clear_request(&req); 
-		read(fdin, &req, sizeof(struct request));
+		cgc_receive(fdin, &req, sizeof(struct request));
 		done = handleCommand(fdout, &req, &res);
 	} while (!done);
 }
-- 
GitLab