Mercurial > dovecot > original-hg > dovecot-1.2
changeset 3762:4d44a337ac08 HEAD
Fixed to work with struct dqblk.dqb_curspace also which is apparently the
new Linux-way to do it.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 24 Dec 2005 00:38:25 +0200 |
parents | ef482c909771 |
children | 454863612b5c |
files | configure.in src/plugins/quota/quota-fs.c src/plugins/quota/quota-fs.h |
diffstat | 3 files changed, 38 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/configure.in Wed Dec 21 20:43:16 2005 +0200 +++ b/configure.in Sat Dec 24 00:38:25 2005 +0200 @@ -1008,6 +1008,36 @@ AC_MSG_RESULT(no) ]) +dnl * Check if we have struct dqblk.dqb_curblocks +AC_MSG_CHECKING([if struct dqblk.dqb_curblocks exists]) +AC_TRY_COMPILE([ + #include <sys/types.h> + #include <sys/quota.h> +], [ + struct dqblk dqblk; + unsigned int x = dqblk.dqb_curblocks; +], [ + AC_DEFINE(HAVE_STRUCT_DQBLK_CURBLOCKS,, Define if struct sqblk.dqb_curblocks exists) + AC_MSG_RESULT(yes) +], [ + AC_MSG_RESULT(no) +]) + +dnl * Check if we have struct dqblk.dqb_curspace +AC_MSG_CHECKING([if struct dqblk.dqb_curspace exists]) +AC_TRY_COMPILE([ + #include <sys/types.h> + #include <sys/quota.h> +], [ + struct dqblk dqblk; + unsigned int x = dqblk.dqb_curspace; +], [ + AC_DEFINE(HAVE_STRUCT_DQBLK_CURSPACE,, Define if struct sqblk.dqb_curspace exists) + AC_MSG_RESULT(yes) +], [ + AC_MSG_RESULT(no) +]) + dnl *** dnl *** va_copy checks (from GLIB) dnl ***
--- a/src/plugins/quota/quota-fs.c Wed Dec 21 20:43:16 2005 +0200 +++ b/src/plugins/quota/quota-fs.c Sat Dec 24 00:38:25 2005 +0200 @@ -14,6 +14,10 @@ #include <unistd.h> #include <sys/stat.h> +#ifdef HAVE_STRUCT_DQBLK_CURSPACE +# define dqb_curblocks dqb_curspace +#endif + #define MTAB_PATH "/etc/mtab" struct fs_quota {
--- a/src/plugins/quota/quota-fs.h Wed Dec 21 20:43:16 2005 +0200 +++ b/src/plugins/quota/quota-fs.h Sat Dec 24 00:38:25 2005 +0200 @@ -1,7 +1,10 @@ #ifndef __QUOTA_FS_H #define __QUOTA_FS_H -#define HAVE_FS_QUOTA +#if defined (HAVE_STRUCT_DQBLK_CURBLOCKS) || \ + defined (HAVE_STRUCT_DQBLK_CURSPACE) +# define HAVE_FS_QUOTA +#endif #ifdef HAVE_SYS_QUOTA_H # include <sys/quota.h> /* Linux */