Re: [LAU] building csound from source - OOps/remote.c:70: error: storage size of 'ifr' isn't known

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: linux-audio-user <linux-audio-user@...>
Date: Monday, July 7, 2008 - 8:47 pm

I think this is strictly a csound build error -- I probably didn't set
something correctly (which I set nothing), but I can't find out what
it is. Before I go delving into this, I'm sure someone can tell me
what I didn't set right..

To compile is just:

# scons

The error:
===
OOps/remote.c: In function 'getIpAddress':
OOps/remote.c:70: error: storage size of 'ifr' isn't known
scons: *** [OOps/remote.o] Error 1
scons: building terminated because of errors.
===

I'm compiling on Linux 64_x86. The error, I suppose, shows up in the
strcpy below (from remote.c):

#ifdef HAVE_SOCKETS

/* get the IPaddress of this machine */
static int getIpAddress(char *ipaddr, char *ifname)
{
int ret = 1;
#ifdef WIN32
/* VL 12/10/06: something needs to go here */
/* gethostbyname is the real answer; code below id unsafe */
char hostname[1024];
struct hostent *he;
struct sockaddr_in sin;
gethostname(hostname, sizeof(hostname));
he = gethostbyname(hostname);

memset(&sin, 0, sizeof (struct sockaddr_in));
memmove(&sin.sin_addr, he->h_addr_list[0], he->h_length);
strcpy(ipaddr, inet_ntoa (sin.sin_addr));
ret = 0;

#else
struct ifreq ifr;
int fd;

fd = socket(AF_INET,SOCK_DGRAM, 0);
if (fd >= 0) {
strcpy(ifr.ifr_name, ifname);

if (ioctl(fd, SIOCGIFADDR, &ifr) == 0) {
char *local;
local = inet_ntoa(((struct sockaddr_in *)(&ifr.ifr_addr))->sin_addr);
strcpy(ipaddr, local);
ret = 0;
}
}
close(fd);
#endif
return ret;

Brad Fuller wrote:

_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-user

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [LAU] building csound from source - OOps/remote.c:70: er..., Brad Fuller, (Mon Jul 7, 8:47 pm)