From d018a6a3b3c67add1485c92036b9910e5c04dd85 Mon Sep 17 00:00:00 2001
From: an7s <an7s@git.zephyr-software.com>
Date: Thu, 10 Dec 2015 21:51:02 +0000
Subject: [PATCH] added buffrecv to configure.in added missing #ifdef CGC

---
 configure.in     | 4 +++-
 libc/src/close.c | 2 ++
 libc/src/open.c  | 2 ++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/configure.in b/configure.in
index d4a8610..742912c 100644
--- a/configure.in
+++ b/configure.in
@@ -7,6 +7,7 @@ AC_PROG_CC
 AC_ARG_ENABLE([debugging],              [  --enable-debugging                enable -g when compiling])
 AC_ARG_ENABLE([cgc],              	[  --enable-cgc                enable -DCGC when compiling for CGC binaries])
 AC_ARG_ENABLE([inferfn],              	[  --enable-inferfn                enable -DCGC when compiling for CGC binaries])
+AC_ARG_ENABLE([buffrecv],              	[  --enable-buffrecv                enable -DCGC when compiling for CGC binaries])
 AC_ARG_ENABLE([libc],              	[  --enable-libc                enable $1 for building ])
 
 enable_dir()
@@ -28,7 +29,7 @@ enable_dir()
 	fi
 }
 
-OPTIMIZE="-O3"
+OPTIMIZE="-O"
 if test "$enable_debugging" = yes; then
         OPTIMIZE="-g  -DDEBUG"
 fi
@@ -71,6 +72,7 @@ enable_dir rss
 enable_dir hookdynamic
 enable_dir canaries
 enable_dir cookbook
+enable_dir buffrecv
 
 AC_OUTPUT(Makefile)
 
diff --git a/libc/src/close.c b/libc/src/close.c
index 0512a6f..7df6217 100644
--- a/libc/src/close.c
+++ b/libc/src/close.c
@@ -23,6 +23,8 @@
 
 int close(int fd)
 {
+#ifndef CGC
 	syscall(SYS_close,fd);
+#endif
 }
 
diff --git a/libc/src/open.c b/libc/src/open.c
index 27ec96e..21b943f 100644
--- a/libc/src/open.c
+++ b/libc/src/open.c
@@ -23,6 +23,8 @@
 
 int open(char *file, int mode)
 {
+#ifndef CGC
 	syscall(SYS_open,file,mode);
+#endif
 }
 
-- 
GitLab