From e6eb6100ab80541cbb65fbbaf091892dea634404 Mon Sep 17 00:00:00 2001 From: leitner Date: Sat, 7 Sep 2002 11:31:53 +0000 Subject: [PATCH] be friendly to non-Linux non-gcc systems --- Makefile | 6 +++--- ldif_parse.c | 4 +++- t1.c | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 8166dc8..198af56 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ endif ar cru $@ $^ %: %.c - $(DIET) $(CC) $(CFLAGS) -o $@ $^ -lowfat + $(DIET) $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lowfat t1 parse: ldif.a storage.a t2: ldap.a asn1.a @@ -54,10 +54,10 @@ bindrequest tinyldap tinyldap_standalone tinyldap_debug ldapclient ldapclient_st idx2ldif: ldap.a tinyldap_standalone: tinyldap.c - $(DIET) $(CC) $(CFLAGS) -DSTANDALONE -o $@ $^ -lowfat + $(DIET) $(CC) $(CFLAGS) -DSTANDALONE -o $@ $^ $(LDFLAGS) -lowfat tinyldap_debug: tinyldap.c - $(DIET) $(CC) $(CFLAGS) -DSTANDALONE -DDEBUG -o $@ $^ -lowfat + $(DIET) $(CC) $(CFLAGS) -DSTANDALONE -DDEBUG -o $@ $^ $(LDFLAGS) -lowfat .PHONY: clean tar clean: diff --git a/ldif_parse.c b/ldif_parse.c index 6010a5f..946282d 100644 --- a/ldif_parse.c +++ b/ldif_parse.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -195,8 +196,9 @@ struct ldaprec *first=0; int ldif_parse(const char* filename) { char buf[4096]; int fd=open_read(filename); - buffer in=BUFFER_INIT(read,fd,buf,sizeof buf); + buffer in; if (fd<0) return 1; + buffer_init(&in,read,fd,buf,sizeof buf); dn=mduptab_adds(&attributes,"dn"); objectClass=mduptab_adds(&attributes,"objectClass"); { diff --git a/t1.c b/t1.c index 77ba030..0491c49 100644 --- a/t1.c +++ b/t1.c @@ -115,8 +115,9 @@ struct ldaprec *first=0; int parse_ldif(const char* filename) { char buf[4096]; int fd=open_read(filename); - buffer in=BUFFER_INIT(read,fd,buf,sizeof buf); + buffer in; if (fd<0) return 1; + buffer_init(&in,read,fd,buf,sizeof buf); dn=strduptab_add(&tags,"dn"); mail=strduptab_add(&tags,"mail"); sn=strduptab_add(&tags,"sn");