Skip to content

Commit

Permalink
quota: Stricter check for rpcsvc in meson
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed May 29, 2024
1 parent 18de0ed commit 85a76aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions etc/afpd/nfsquota.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "config.h"
#endif /* HAVE_CONFIG_H */

#if !defined(NO_QUOTA_SUPPORT) && !defined(HAVE_LIBQUOTA)
#if !defined(NO_QUOTA_SUPPORT) || defined(HAVE_LIBQUOTA)
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
Expand Down Expand Up @@ -65,7 +65,7 @@
static int
callaurpc(struct vol *vol,
u_long prognum, u_long versnum, u_long procnum,
xdrproc_t inproc, char *in,
xdrproc_t inproc, char *in,
xdrproc_t outproc, char *out)
{
enum clnt_stat clnt_stat;
Expand Down Expand Up @@ -187,4 +187,4 @@ int getnfsquota(struct vol *vol, const int uid, const u_int32_t bsize,
*hostpath = ':';
return AFPERR_PARAM;
}
#endif /* ! NO_QUOTA_SUPPORT && !HAVE_LIBQUOTA */
#endif /* ! NO_QUOTA_SUPPORT || HAVE_LIBQUOTA */
7 changes: 5 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -764,12 +764,15 @@ else
or cc.has_header('rpcsvc/rquota.h')
)
)
have_quota = cc.has_function('main', dependencies: rpcsvc)
have_rpcsvc = cc.has_function('main', dependencies: rpcsvc)
quota_link_args += '-lrpcsvc'
if quota.found()
if quota.found() and have_rpcsvc
have_quota = cc.has_function('getfsquota', dependencies: quota)
cdata.set('HAVE_LIBQUOTA', 1)
quota_link_args += ['-lquota', '-lprop', '-lrpcsvc']
else
have_quota = false
cdata.set('NO_QUOTA_SUPPORT', 1)
endif
else
have_quota = false
Expand Down

0 comments on commit 85a76aa

Please sign in to comment.