Skip to content

Commit

Permalink
Fix several mod_destroy() prototypes
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu authored and bogdan-iancu committed Apr 18, 2024
1 parent 5409442 commit 63de77b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 32 deletions.
5 changes: 2 additions & 3 deletions modules/httpd/httpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

/* module functions */
static int mod_init();
static int destroy(void);
static void destroy(void);

static mi_response_t *mi_list_root_path(const mi_params_t *params,
struct mi_handler *async_hdl);
Expand Down Expand Up @@ -187,7 +187,7 @@ static int mod_init(void)
}


int destroy(void)
static void destroy(void)
{
struct httpd_cb *cb = httpd_cb_list;

Expand All @@ -198,7 +198,6 @@ int destroy(void)
shm_free(cb);
cb = httpd_cb_list;
}
return 0;
}


Expand Down
13 changes: 4 additions & 9 deletions modules/mi_datagram/mi_datagram.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

static int mi_mod_init(void);
static int mi_child_init(int rank);
static int mi_destroy(void);
static void mi_destroy(void);
static int pre_datagram_process(void);
static int post_datagram_process(void);
static void datagram_process(int rank);
Expand Down Expand Up @@ -345,7 +345,7 @@ static int post_datagram_process(void)
}


static int mi_destroy(void)
static void mi_destroy(void)
{
int n;
struct stat filestat;
Expand All @@ -357,16 +357,11 @@ static int mi_destroy(void)
if (unlink(mi_socket)<0){
LM_ERR("cannot delete the socket (%s): %s\n",
mi_socket, strerror(errno));
goto error;
return;
}
} else if (n<0 && errno!=ENOENT) {
LM_ERR("socket stat failed: %s\n", strerror(errno));
goto error;
return;
}
}

return 0;
error:
return -1;

}
12 changes: 4 additions & 8 deletions modules/mi_fifo/mi_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

static int mi_mod_init(void);
static void fifo_process(int rank);
static int mi_destroy(void);
static void mi_destroy(void);

/* FIFO server vars */
/* FIFO name */
Expand Down Expand Up @@ -228,7 +228,7 @@ static void fifo_process(int rank)
}


static int mi_destroy(void)
static void mi_destroy(void)
{
int n;
struct stat filestat;
Expand All @@ -240,15 +240,11 @@ static int mi_destroy(void)
if (unlink(mi_fifo)<0){
LM_ERR("cannot delete the fifo (%s): %s\n",
mi_fifo, strerror(errno));
goto error;
return;
}
} else if (n<0 && errno!=ENOENT) {
LM_ERR("FIFO stat failed: %s\n", strerror(errno));
goto error;
return;
}

return 0;
error:
return -1;
}

5 changes: 2 additions & 3 deletions modules/mi_html/mi_html.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

/* module functions */
static int mod_init();
static int destroy(void);
static void destroy(void);
int mi_http_answer_to_connection (void *cls, void *connection,
const char *url, const char *method,
const char *version, const char *upload_data,
Expand Down Expand Up @@ -177,10 +177,9 @@ static int mod_init(void)
}


int destroy(void)
static void destroy(void)
{
mi_http_destroy_async_lock();
return 0;
}


Expand Down
5 changes: 2 additions & 3 deletions modules/mi_http/mi_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

/* module functions */
static int mod_init();
static int destroy(void);
static void destroy(void);
int mi_json_answer_to_connection (void *cls, void *connection,
const char *url, const char *method,
const char *version, const char *upload_data,
Expand Down Expand Up @@ -169,10 +169,9 @@ static int mod_init(void)
}


int destroy(void)
static void destroy(void)
{
mi_json_destroy_async_lock();
return 0;
}


Expand Down
5 changes: 2 additions & 3 deletions modules/mi_xmlrpc_ng/mi_xmlrpc_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ str xml_strerr[] = {

/* module functions */
static int mod_init();
static int destroy(void);
static void destroy(void);
int mi_xmlrpc_http_answer_to_connection (void *cls, void *connection,
const char *url, const char *method,
const char *version, const char *upload_data,
Expand Down Expand Up @@ -172,10 +172,9 @@ static int mod_init(void)
}


int destroy(void)
static void destroy(void)
{
mi_xmlrpc_http_destroy_async_lock();
return 0;
}


Expand Down
5 changes: 2 additions & 3 deletions modules/pi_http/pi_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extern ph_framework_t *ph_framework_data;
/* module functions */
static int mod_init();
static int child_init(int);
static int destroy(void);
static void destroy(void);
int ph_answer_to_connection (void *cls, void *connection,
const char *url, const char *method,
const char *version, const char *upload_data,
Expand Down Expand Up @@ -225,11 +225,10 @@ static int child_init(int rank)
}


int destroy(void)
static void destroy(void)
{
destroy_http_db(ph_framework_data);
ph_destroy_async_lock();
return 0;
}


Expand Down

0 comments on commit 63de77b

Please sign in to comment.