include config.h from lib/socket.c and use this to conditionaly

compile code to set sin_len on platforms that require this field
in the sockaddr structures.
This commit is contained in:
Ronnie Sahlberg
2010-12-05 13:53:41 +11:00
parent 631954405a
commit 3d3da6c6e3
2 changed files with 5 additions and 1 deletions

View File

@@ -4,7 +4,7 @@ libdir = @libdir@
bindir = @bindir@
LIBS="-lpopt"
CC=gcc
CFLAGS=-g -O0 -fPIC -Wall -W -I./include "-D_U_=__attribute__((unused))"
CFLAGS=-g -O0 -fPIC -Wall -W -I. -I./include "-D_U_=__attribute__((unused))"
LIBISCSI_OBJ = lib/connect.o lib/crc32c.o lib/discovery.o lib/init.o lib/login.o lib/nop.o lib/pdu.o lib/scsi-command.o lib/scsi-lowlevel.o lib/socket.o lib/sync.o
INSTALLCMD = /usr/bin/install -c

View File

@@ -14,6 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
@@ -98,6 +99,9 @@ iscsi_connect_async(struct iscsi_context *iscsi, const char *portal,
return -1;
}
#ifdef HAVE_SOCK_SIN_LEN
s.ss_len = socksize;
#endif
if (iscsi->fd == -1) {
iscsi_set_error(iscsi, "Failed to open iscsi socket. "