FreeBSD compatibility (Dirk Meyer)

This commit is contained in:
leitner
2004-02-26 17:26:30 +00:00
parent 76344d0ee6
commit fbc0865c50
7 changed files with 19 additions and 6 deletions

View File

@@ -47,7 +47,7 @@ endif
ar cru $@ $^
%: %.c
$(DIET) $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lowfat
$(DIET) $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lowfat ${LIBS}
t1 parse: ldif.a storage.a
t2: ldap.a asn1.a
@@ -58,10 +58,10 @@ bindrequest tinyldap tinyldap_standalone tinyldap_debug ldapclient ldapclient_st
idx2ldif: ldap.a
tinyldap_standalone: tinyldap.c
$(DIET) $(CC) $(CFLAGS) -DSTANDALONE -o $@ $^ $(LDFLAGS) -lowfat
$(DIET) $(CC) $(CFLAGS) -DSTANDALONE -o $@ $^ $(LDFLAGS) -lowfat ${LIBS}
tinyldap_debug: tinyldap.c
$(DIET) $(CC) $(CFLAGS) -DSTANDALONE -DDEBUG -o $@ $^ $(LDFLAGS) -lowfat
$(DIET) $(CC) $(CFLAGS) -DSTANDALONE -DDEBUG -o $@ $^ $(LDFLAGS) -lowfat ${LIBS}
.PHONY: clean tar
clean:

2
THANKS
View File

@@ -5,3 +5,5 @@ David Lichteblau found lots of problems in the ASN.1 code.
Özgür Kesim helped fix the substring search.
Thomas Walpuski has found lots of problems with the LDAP code.
Dirk Meyer helped BSD portability

3
auth.c
View File

@@ -1,3 +1,6 @@
#ifdef __FreeBSD__
#include <sys/types.h>
#endif
#include <md5.h>
#include "ldap.h"
#include "auth.h"

View File

@@ -35,6 +35,7 @@ int main(int argc,char* argv[]) {
unsigned long filelen;
char* fn=argc<2?"data":argv[1];
char* map=mmap_read(fn,&filelen);
uint32 magic,attribute_count,record_count,indices_offset,size_of_string_table;
if (!map) {
buffer_puts(buffer_2,"could not open ");
buffer_puts(buffer_2,fn);
@@ -43,7 +44,6 @@ int main(int argc,char* argv[]) {
buffer_putnlflush(buffer_2);
return 1;
}
uint32 magic,attribute_count,record_count,indices_offset,size_of_string_table;
uint32_unpack(map,&magic);
uint32_unpack(map+4,&attribute_count);
uint32_unpack(map+2*4,&record_count);

View File

@@ -1,3 +1,6 @@
#ifdef __FreeBSD__
#include <sys/types.h>
#endif
#include <md5.h>
#include <string.h>
#include "buffer.h"

View File

@@ -54,9 +54,9 @@ long mstorage_add(mstorage_t* p,const char* s,unsigned long n) {
if (!tmp) return -1;
} else {
munmap(p->root,p->used);
tmp=mmap(0,need,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0);
tmp=mmap(0,need,PROT_READ|PROT_WRITE,MAP_SHARED,p->fd,0);
if (tmp==-1) {
tmp=mmap(0,p->used,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0);
tmp=mmap(0,p->used,PROT_READ|PROT_WRITE,MAP_SHARED,p->fd,0);
/* this can never fail, because we mmap exactly as much as we
* had mmapped previously. We need to munmap before doing the
* new mmap, though, because we may run into the address space

View File

@@ -14,8 +14,13 @@
#ifdef STANDALONE
#include "socket.h"
#include "ip6.h"
#ifdef __FreeBSD__
#include <sys/types.h>
#include <sys/wait.h>
#else
#include <wait.h>
#endif
#endif
#include "case.h"
#include <signal.h>