fixed ifaddrs support

This commit is contained in:
roberto@nexenta32
2011-05-26 06:17:46 +02:00
parent ae6780a487
commit 431e05d4f4
3 changed files with 10 additions and 1 deletions
+5 -1
View File
@@ -325,7 +325,6 @@ char *generate_socket_name(char *socket_name) {
char *asterisk = strchr(socket_name, '*');
char *new_socket;
char *tcp_port;
int i;
char *ptr = socket_name;
@@ -354,6 +353,10 @@ char *generate_socket_name(char *socket_name) {
if (asterisk) {
#ifndef UWSGI_HAS_IFADDRS
uwsgi_log("your system does not support ifaddrs subsystem\n");
#else
char *new_socket;
uwsgi_log("generate_socket_name(%s)\n", socket_name);
// get all the AF_INET addresses available
struct ifaddrs *ifap = NULL, *ifa, *ifaf;
@@ -390,6 +393,7 @@ char *generate_socket_name(char *socket_name) {
}
uwsgi_log("unable to find avalid socket address\n");
#endif
uwsgi_nuclear_blast();
}
return socket_name;
+2
View File
@@ -94,7 +94,9 @@
#include <syslog.h>
#ifdef UWSGI_HAS_IFADDRS
#include <ifaddrs.h>
#endif
#include <dirent.h>
+3
View File
@@ -240,6 +240,9 @@ class uConf(object):
self.cflags.append('-DUWSGI_BUILD_DATE="\\"%s\\""' % time.strftime("%d %B %Y %H:%M:%S"))
kvm_list = ['FreeBSD', 'OpenBSD', 'NetBSD', 'DragonFly']
if os.path.exists('/usr/include/ifaddrs.h') or os.path.exists('/usr/local/include/ifaddrs.h'):
self.cflags.append('-DUWSGI_HAS_IFADDRS')
if uwsgi_os == 'SunOS':
self.libs.append('-lsendfile')
self.gcc_list.append('lib/sun_fixes')