* Fix some issues with uClibc.

This commit is contained in:
Justin Maggard 2009-10-28 07:44:45 +00:00
parent f36047098c
commit 41f204029b
8 changed files with 31 additions and 7 deletions

View File

@ -35,7 +35,7 @@ BASEOBJS = minidlna.o upnphttp.o upnpdescgen.o upnpsoap.o \
ALLOBJS = $(BASEOBJS) $(LNXOBJS)
LIBS = -lexif -ljpeg -lsqlite3 -lavformat -lid3tag -lFLAC -lvorbis
LIBS = -lpthread -lexif -ljpeg -lsqlite3 -lavformat -lid3tag -lFLAC -lvorbis
#STATIC_LINKING: LIBS = -lvorbis -logg -lm -lsqlite3 -lpthread -lexif -ljpeg -lFLAC -lm -lid3tag -lz -lavformat -lavutil -lavcodec -lm
TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o

View File

@ -159,6 +159,15 @@ echo "/*#define HAVE_INOTIFY_H*/" >> ${CONFIGFILE}
fi
echo "" >> ${CONFIGFILE}
echo "/* Enable if the system iconv.h exists. ID3 tag reading in various character sets will not work properly otherwise. */" >> ${CONFIGFILE}
if [ -f /usr/include/iconv.h ]; then
echo "#define HAVE_ICONV_H" >> ${CONFIGFILE}
else
echo -e "\nWARNING!! Iconv support not found. ID3 tag reading may not work."
echo "/*#define HAVE_ICONV_H*/" >> ${CONFIGFILE}
fi
echo "" >> ${CONFIGFILE}
echo "/* Enable NETGEAR-specific tweaks. */" >> ${CONFIGFILE}
echo "${NETGEAR}" >> ${CONFIGFILE}
echo "/* Enable ReadyNAS-specific tweaks. */" >> ${CONFIGFILE}

View File

@ -109,7 +109,7 @@ getsyshwaddr(char * buf, int len)
if(!ifaces)
return(ret);
for(if_idx = ifaces+2; if_idx->if_index; if_idx++)
for(if_idx = ifaces; if_idx->if_index; if_idx++)
{
strncpy(ifr.ifr_name, if_idx->if_name, IFNAMSIZ);
if(ioctl(fd, SIOCGIFFLAGS, &ifr) < 0)
@ -118,6 +118,8 @@ getsyshwaddr(char * buf, int len)
continue;
if( ioctl(fd, SIOCGIFHWADDR, &ifr) < 0 )
continue;
if( MACADDR_IS_ZERO(&ifr.ifr_hwaddr.sa_data) )
continue;
ret = 0;
break;
}

View File

@ -8,6 +8,14 @@
#define __GETIFADDR_H__
#include <arpa/inet.h>
#define MACADDR_IS_ZERO(x) \
((x[0] == 0x00) && \
(x[1] == 0x00) && \
(x[2] == 0x00) && \
(x[3] == 0x00) && \
(x[4] == 0x00) && \
(x[5] == 0x00))
/* getifaddr()
* take a network interface name and write the
* ip v4 address as text in the buffer

View File

@ -37,6 +37,7 @@ do_iconv(const char* to_ces, const char* from_ces,
char *inbuf, size_t inbytesleft,
char *outbuf_orig, size_t outbytesleft_orig)
{
#ifdef HAVE_ICONV_H
size_t rc;
iconv_result ret = ICONV_OK;
@ -65,6 +66,9 @@ do_iconv(const char* to_ces, const char* from_ces,
iconv_close(cd);
return ret;
#else // HAVE_ICONV_H
return ICONV_FATAL;
#endif // HAVE_ICONV_H
}
#define N_LANG_ALT 8

View File

@ -31,13 +31,15 @@
#include <fcntl.h>
#include <unistd.h>
#include <time.h>
#include <iconv.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <ogg/ogg.h>
#include <vorbis/codec.h>
#include <FLAC/metadata.h>
#include <netinet/in.h>
#ifdef HAVE_ICONV_H
#include <iconv.h>
#endif
#include <sqlite3.h>
#include "tagutils.h"

View File

@ -301,6 +301,8 @@ set_filter_flags(char * filter)
item = strtok_r(filter, ",", &saveptr);
while( item != NULL )
{
if( saveptr )
*(saveptr-1) = ',';
if( strcmp(item, "@childCount") == 0 )
{
flags |= FILTER_CHILDCOUNT;
@ -400,8 +402,6 @@ set_filter_flags(char * filter)
flags |= FILTER_RES;
flags |= FILTER_RES_SIZE;
}
if( *saveptr )
*(saveptr-1) = ',';
item = strtok_r(NULL, ",", &saveptr);
}

1
uuid.c
View File

@ -16,7 +16,6 @@
#include <unistd.h>
#include <sys/syscall.h>
#include <string.h>
#include <ifaddrs.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <sys/time.h>