X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=libatalk%2Fadouble%2Fad_private.h;h=771ec32482080e10e8dfaea583415dea0024e40d;hb=9d78f9b52ea18b442fc91c6a1e8d8b607f2f90e8;hp=3814e649d42ad297f9558834aa1be20996501ab2;hpb=31843674b7bd32eabcce3a1ad6159b4f94921f79;p=netatalk.git diff --git a/libatalk/adouble/ad_private.h b/libatalk/adouble/ad_private.h index 3814e649..771ec324 100644 --- a/libatalk/adouble/ad_private.h +++ b/libatalk/adouble/ad_private.h @@ -1,3 +1,7 @@ +/* + * $Id: ad_private.h,v 1.5.8.1 2008-11-25 15:16:34 didg Exp $ + */ + #ifndef LIBATALK_ADOUBLE_AD_PRIVATE_H #define LIBATALK_ADOUBLE_AD_PRIVATE_H 1 @@ -5,31 +9,27 @@ #ifndef MAP_FAILED #define MAP_FAILED ((void *) -1) -#endif - -#ifndef __inline__ -#define __inline__ -#endif +#endif /* ! MAP_FAILED */ /* this is so that we can keep lists of fds referencing the same file * around. that way, we can honor locks created by the same process * with the same file. */ -#ifdef USE_FLOCK_LOCKS -#define adf_lock_init(a) -#define adf_lock_free(a) -#else #define adf_lock_init(a) do { \ (a)->adf_lockmax = (a)->adf_lockcount = 0; \ - (a)->adf_lock = NULL; \ + (a)->adf_excl = 0;(a)->adf_lock = NULL; \ } while (0) #define adf_lock_free(a) do { \ + int i;\ if (!(a)->adf_lock) \ break; \ + for (i = 0; i < (a)->adf_lockcount; i++) {\ + adf_lock_t *lock = (a)->adf_lock + i;\ + if (--(*lock->refcount) < 1)free(lock->refcount); \ + }\ free((a)->adf_lock); \ adf_lock_init(a); \ } while (0) -#endif #endif /* libatalk/adouble/ad_private.h */