From 480a552f441deef834796c33df4c214b1011c97b Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Mon, 26 Jul 2004 22:22:40 +0000 Subject: [PATCH] - Check for init/finalize - Use ompi_comm_invalid() to check for invalid communicator This commit was SVN r1810. --- src/mpi/c/comm_set_errhandler.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mpi/c/comm_set_errhandler.c b/src/mpi/c/comm_set_errhandler.c index bb4b3e991a..dfdd237c6d 100644 --- a/src/mpi/c/comm_set_errhandler.c +++ b/src/mpi/c/comm_set_errhandler.c @@ -17,21 +17,23 @@ #include "mpi/c/profile/defines.h" #endif +static char FUNC_NAME[] = "MPI_Comm_set_errhandler"; + int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler) { /* Error checking */ if (MPI_PARAM_CHECK) { - if (NULL == comm || - MPI_COMM_NULL == comm) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Comm_set_errhandler"); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (ompi_comm_invalid(comm)) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, + FUNC_NAME); } else if (NULL == errhandler || MPI_ERRHANDLER_NULL == errhandler || OMPI_ERRHANDLER_TYPE_COMM != errhandler->eh_mpi_object_type) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, - "MPI_Comm_set_errhandler"); + FUNC_NAME); } }