avalluri / open-tr069

Automatically exported from code.google.com/p/open-tr069
7 stars 3 forks source link

error: conflicting types for shutdown #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. compile the code
2.
3.

What is the expected output? What do you see instead?
Code should have been compiles successfully but it is showing compilation error.

What version of the product are you using? On what operating system?
latest code from SVN

Please provide any additional information below.
Follwing compilation issue is reported:
evcpe.c:54: error: conflicting types for âshutdownâ
/usr/include/sys/socket.h:232: note: previous declaration of âshutdownâ was 
here
make: *** [evcpe.o] Error 1

Original issue reported on code.google.com by anurag.r...@gmail.com on 8 Sep 2011 at 4:30

GoogleCodeExporter commented 9 years ago
Renaming the shutdown-functions solves this:

Index: evcpe.c
===================================================================
--- evcpe.c (revision 14)
+++ evcpe.c (working copy)
@@ -51,7 +51,7 @@

 static int load_file(const char *filename, struct evbuffer *buffer);

-static int shutdown(int code);
+static int evcpe_shutdown(int code);

 static void help(FILE *stream)
 {
@@ -69,7 +69,7 @@
        enum evcpe_error_type type, int code, const char *reason, void *cbarg)
 {
    evcpe_error(__func__, "type: %d, code: %d, reason: %s", type, code, reason);
-   shutdown(code);
+   evcpe_shutdown(code);
 }

 int main(int argc, char **argv)
@@ -250,10 +250,10 @@
 {
    evcpe_info(__func__, "signal caught: %d", signal);
    if (signal == SIGINT)
-       shutdown(0);
+       evcpe_shutdown(0);
 }

-int shutdown(int code)
+int evcpe_shutdown(int code)
 {
    evcpe_info(__func__, "shuting down with code: %d (%s)", code, strerror(code));
    event_base_loopbreak(this.evbase);

Original comment by kaspar...@googlemail.com on 6 Feb 2012 at 2:21