From: Karl Fleischmann Date: Mon, 13 Jun 2022 13:10:53 +0000 (+0200) Subject: lib/compat.h: Remove workardound for dev_t comparisons X-Git-Tag: 2.4.0~3823 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7e6c7557966df84985f711c19c9b1ecd4eddfec;p=thirdparty%2Fdovecot%2Fcore.git lib/compat.h: Remove workardound for dev_t comparisons dev_t is defined by POSIX to be a number, and all supported systems define major() and minor() at one place or the other, thus this commit removes the workarounds. --- diff --git a/configure.ac b/configure.ac index 86844870a1..128ea2c0e6 100644 --- a/configure.ac +++ b/configure.ac @@ -425,8 +425,6 @@ AC_C_FLEXIBLE_ARRAY_MEMBER DOVECOT_IOVEC -DOVECOT_TYPEOF_DEV_T - DOVECOT_RLIMIT_AS DOVECOT_RLIMIT_NPROC DOVECOT_RLIMIT_CORE diff --git a/m4/typeof_dev_t.m4 b/m4/typeof_dev_t.m4 deleted file mode 100644 index 4fce9dfd9c..0000000000 --- a/m4/typeof_dev_t.m4 +++ /dev/null @@ -1,18 +0,0 @@ -dnl * is dev_t an integer or something else? -AC_DEFUN([DOVECOT_TYPEOF_DEV_T], [ - AC_CACHE_CHECK([whether dev_t is struct],i_cv_dev_t_struct,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - struct test { dev_t a; }; - static struct test t = { 0 }; - ]], - [[ ]])], [ - i_cv_dev_t_struct=no - ],[ - i_cv_dev_t_struct=yes - ]) - ]) - AS_IF([test $i_cv_dev_t_struct = yes], [ - AC_DEFINE(DEV_T_STRUCT,, [Define if your dev_t is a structure instead of integer type]) - ]) -]) diff --git a/src/lib/compat.h b/src/lib/compat.h index 82aa1fa831..a7dd66d658 100644 --- a/src/lib/compat.h +++ b/src/lib/compat.h @@ -71,26 +71,10 @@ typedef unsigned long long uoff_t; # undef WORDS_BIGENDIAN #endif -/* - * - * - * - * POSIX.1-2001 - * - * - * - */ #ifdef HAVE_SYS_SYSMACROS_H # include -# ifdef HAVE_SYS_MKDEV_H -# include /* UnixWare */ -# endif -# define CMP_DEV_T(a, b) (major(a) == major(b) && minor(a) == minor(b)) -#elif !defined (DEV_T_STRUCT) -# define CMP_DEV_T(a, b) ((a) == (b)) -#else -# error I do not know how to compare dev_t #endif +#define CMP_DEV_T(a, b) (major(a) == major(b) && minor(a) == minor(b)) #ifdef HAVE_STAT_XTIM # define HAVE_ST_NSECS