Skip to content

Commit

Permalink
meson: Check for SunRPC function quota_open(), GitHub #1225
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Nov 22, 2024
1 parent c6b7293 commit cb02a80
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
6 changes: 5 additions & 1 deletion etc/afpd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions etc/afpd/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <atalk/util.h>

#include "auth.h"
#include "directory.h"
#include "volume.h"
#include "unix.h"

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion test/afpd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit cb02a80

Please sign in to comment.