diff options
author | Martin Willi <martin@strongswan.org> | 2008-11-11 18:37:19 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2008-11-11 18:37:19 +0000 |
commit | 479f295049956333253310025d3776279e932b46 (patch) | |
tree | e0d6113484a5e191c14a8649f9634cfa15087464 /src/charon | |
parent | 3d2dbebd703fe29c0981f61102094ffe2a4a2101 (diff) | |
download | strongswan-479f295049956333253310025d3776279e932b46.tar.bz2 strongswan-479f295049956333253310025d3776279e932b46.tar.xz |
fixed compiler warnings issued by:
gcc 4.3
curl.h gcc type-checking
glibc with enabled FORTIFY_SOURCE checking
Diffstat (limited to 'src/charon')
-rw-r--r-- | src/charon/daemon.c | 2 | ||||
-rw-r--r-- | src/charon/plugins/sql/sql_attribute.c | 2 | ||||
-rw-r--r-- | src/charon/plugins/updown/updown_plugin.c | 20 | ||||
-rw-r--r-- | src/charon/sa/ike_sa.c | 4 |
4 files changed, 21 insertions, 7 deletions
diff --git a/src/charon/daemon.c b/src/charon/daemon.c index c5c43e86b..b9f173901 100644 --- a/src/charon/daemon.c +++ b/src/charon/daemon.c @@ -719,7 +719,7 @@ int main(int argc, char *argv[]) if (pid_file) { fprintf(pid_file, "%d\n", getpid()); - fchown(fileno(pid_file), charon->uid, charon->gid); + ignore_result(fchown(fileno(pid_file), charon->uid, charon->gid)); fclose(pid_file); } diff --git a/src/charon/plugins/sql/sql_attribute.c b/src/charon/plugins/sql/sql_attribute.c index 1e5c28966..f1e206279 100644 --- a/src/charon/plugins/sql/sql_attribute.c +++ b/src/charon/plugins/sql/sql_attribute.c @@ -17,6 +17,8 @@ #include "sql_attribute.h" +#include <time.h> + #include <daemon.h> typedef struct private_sql_attribute_t private_sql_attribute_t; diff --git a/src/charon/plugins/updown/updown_plugin.c b/src/charon/plugins/updown/updown_plugin.c index a0c39e371..f358026f7 100644 --- a/src/charon/plugins/updown/updown_plugin.c +++ b/src/charon/plugins/updown/updown_plugin.c @@ -72,7 +72,10 @@ static void updown(ike_sa_t *ike_sa, child_sa_t *child_sa, bool up) FILE *shell; /* get subnet/bits from string */ - asprintf(&my_client, "%R", my_ts); + if (asprintf(&my_client, "%R", my_ts) < 0) + { + my_client = NULL; + } pos = strchr(my_client, '/'); *pos = '\0'; my_client_mask = pos + 1; @@ -81,7 +84,10 @@ static void updown(ike_sa_t *ike_sa, child_sa_t *child_sa, bool up) { *pos = '\0'; } - asprintf(&other_client, "%R", other_ts); + if (asprintf(&other_client, "%R", other_ts) < 0) + { + other_client = NULL; + } pos = strchr(other_client, '/'); *pos = '\0'; other_client_mask = pos + 1; @@ -93,11 +99,17 @@ static void updown(ike_sa_t *ike_sa, child_sa_t *child_sa, bool up) if (vip) { - asprintf(&virtual_ip, "PLUTO_MY_SOURCEIP='%H' ", vip); + if (asprintf(&virtual_ip, "PLUTO_MY_SOURCEIP='%H' ", vip) < 0) + { + virtual_ip = NULL; + } } else { - asprintf(&virtual_ip, ""); + if (asprintf(&virtual_ip, "") < 0) + { + virtual_ip = NULL; + } } iface = charon->kernel_interface->get_interface( diff --git a/src/charon/sa/ike_sa.c b/src/charon/sa/ike_sa.c index 1c5953cd0..37691fbf7 100644 --- a/src/charon/sa/ike_sa.c +++ b/src/charon/sa/ike_sa.c @@ -2176,7 +2176,7 @@ static void remove_dns_servers(private_ike_sa_t *this) if (!found) { /* write line untouched back to file */ - fwrite(orig_line.ptr, orig_line.len, 1, file); + ignore_result(fwrite(orig_line.ptr, orig_line.len, 1, file)); fprintf(file, "\n"); } } @@ -2230,7 +2230,7 @@ static void add_dns_server(private_ike_sa_t *this, host_t *dns) { this->dns_servers->insert_last(this->dns_servers, dns->clone(dns)); } - fwrite(contents.ptr, contents.len, 1, file); + ignore_result(fwrite(contents.ptr, contents.len, 1, file)); fclose(file); } |