From: Nickolai Zeldovich Date: Fri, 15 Feb 2002 05:07:13 +0000 (+0000) Subject: Use autoconf to check for p_corefile in struct proc, rather than X-Git-Tag: openafs-devel-1_3_0~3 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=d0ffec1b282518ab6d1395bfaad66f0ea8fe9feb;p=packages%2Fo%2Fopenafs.git Use autoconf to check for p_corefile in struct proc, rather than assuming it exists in Solaris 7 and above; nneul@umr.edu reports that it doesn't for some kernel revision. --- diff --git a/acinclude.m4 b/acinclude.m4 index 000d3f0bf..4c96a7fc0 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -153,6 +153,7 @@ case $system in MKAFS_OSTYPE=SOLARIS AC_MSG_RESULT(sun4) SOLARIS_UFSVFS_HAS_DQRWLOCK + SOLARIS_PROC_HAS_P_COREFILE ;; *-hpux*) MKAFS_OSTYPE=HPUX diff --git a/src/cf/solaris-pcorefile.m4 b/src/cf/solaris-pcorefile.m4 new file mode 100644 index 000000000..6764e4215 --- /dev/null +++ b/src/cf/solaris-pcorefile.m4 @@ -0,0 +1,17 @@ +AC_DEFUN(SOLARIS_PROC_HAS_P_COREFILE, [ +AC_MSG_CHECKING(for p_corefile in struct proc) +AC_CACHE_VAL(ac_cv_solaris_proc_has_p_corefile, +[ +AC_TRY_COMPILE( +[#define _KERNEL +#include ], +[struct proc _proc; +(void) _proc.p_corefile;], +ac_cv_solaris_proc_has_p_corefile=yes, +ac_cv_solaris_proc_has_p_corefile=no)]) +AC_MSG_RESULT($ac_cv_solaris_proc_has_p_corefile) +if test "$ac_cv_solaris_proc_has_p_corefile" = "yes"; then + AC_DEFINE(HAVE_P_COREFILE, 1, [define if struct proc has p_corefile]) +fi +]) + diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c index 44438e6fe..b888d8f2b 100644 --- a/src/rx/rx_kcommon.c +++ b/src/rx/rx_kcommon.c @@ -1061,7 +1061,7 @@ void rxk_Listener(void) #endif #ifdef AFS_SUN5_ENV AFS_GUNLOCK(); -#ifdef AFS_SUN57_ENV +#ifdef HAVE_P_COREFILE if (!curproc->p_corefile) /* newproc doesn't set it, but exit frees it */ curproc->p_corefile = refstr_alloc("core"); #endif