diff --git a/etc/afpd/meson.build b/etc/afpd/meson.build index 0af0b6288fb0..b13532b58951 100644 --- a/etc/afpd/meson.build +++ b/etc/afpd/meson.build @@ -73,9 +73,13 @@ endif if have_quota afpd_sources += [ - 'nfsquota.c', 'quota.c', ] + if host_os != 'netbsd' + afpd_sources += [ + 'nfsquota.c', + ] + endif afpd_external_deps += quota_deps endif diff --git a/etc/afpd/quota.c b/etc/afpd/quota.c index 1b7576d73b68..852c78f8f231 100644 --- a/etc/afpd/quota.c +++ b/etc/afpd/quota.c @@ -32,6 +32,7 @@ #include #include "auth.h" +#include "directory.h" #include "volume.h" #include "unix.h" @@ -649,8 +650,10 @@ static int getquota(const AFPObj *obj, struct vol *vol, struct dqblk *dq, const } #endif +#if !defined(__NetBSD__) return vol->v_nfs ? getnfsquota(vol, obj->uid, bsize, dq) : getfsquota(obj, vol, obj->uid, dq); +#endif } static int overquota( struct dqblk *dqblk) diff --git a/meson.build b/meson.build index de2ca674577b..d8f0e895cc10 100644 --- a/meson.build +++ b/meson.build @@ -1017,7 +1017,7 @@ else if have_quota quota_deps += rpcsvc quota_provider += 'SunRPC' - if quota.found() and cc.has_function('getfsquota', dependencies: [quota, prop, rpcsvc]) + if quota.found() and cc.has_function('quota_open', dependencies: [quota, prop, rpcsvc]) quota_deps += [quota, prop] cdata.set('HAVE_LIBQUOTA', 1) endif diff --git a/test/afpd/meson.build b/test/afpd/meson.build index afbab5c699fb..d2f530a37282 100644 --- a/test/afpd/meson.build +++ b/test/afpd/meson.build @@ -56,9 +56,13 @@ endif if have_quota test_sources += [ - meson.project_source_root() / 'etc/afpd/nfsquota.c', meson.project_source_root() / 'etc/afpd/quota.c', ] + if host_os != 'netbsd' + test_sources += [ + meson.project_source_root() / 'etc/afpd/nfsquota.c', + ] + endif test_external_deps += quota_deps endif