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

Re: [Minios-devel] [UNIKRAFT/NGINX PATCH 1/3] Provide main() function if configured to do so



Hi Costin,

There are some minor warnings from checkpatch. You can solve them on upstream.

Reviewed-by: Roxana Nicolescu <nicolescu.roxana1996@xxxxxxxxx>

On 31.10.2019 19:57, Costin Lupu wrote:
We add a config option for enabling the main() function provided by our NGINX
glue code.

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
  Config.uk   | 6 ++++++
  Makefile.uk | 5 +++++
  main.c      | 6 ++++++
  3 files changed, 17 insertions(+)
  create mode 100644 main.c

diff --git a/Config.uk b/Config.uk
index 824dba0..3a78c03 100644
--- a/Config.uk
+++ b/Config.uk
@@ -22,3 +22,9 @@ menuconfig LIBNGINX
        select LWIP_DHCP
        select LWIP_DNS
        select LIBPTHREAD_EMBEDDED
+
+if LIBNGINX
+config LIBNGINX_MAIN_FUNCTION
+       bool "Provide main function"
+       default n
+endif
diff --git a/Makefile.uk b/Makefile.uk
index f0b7837..839a7f8 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -54,6 +54,11 @@ $(eval $(call 
patch,libnginx,$(LIBNGINX_PATCHDIR),nginx-$(LIBNGINX_VERSION)))
  
################################################################################
  LIBNGINX_SRC = $(LIBNGINX_ORIGIN)/$(LIBNGINX_BASENAME)/src
+################################################################################
+# Sources
+################################################################################
+LIBNGINX_SRCS-$(CONFIG_LIBNGINX_MAIN_FUNCTION) += 
$(LIBNGINX_BASE)/main.c|unikraft
+
  
################################################################################
  # Library includes
  
################################################################################
diff --git a/main.c b/main.c
new file mode 100644
index 0000000..19d286d
--- /dev/null
+++ b/main.c
@@ -0,0 +1,6 @@
+extern int nginx_main(int argc, char *argv[]);
+
+int main(int argc, char *argv[])
+{
+       return nginx_main(argc, argv);
+}

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.