From: Arnaud Giersch Date: Fri, 16 Sep 2022 12:19:10 +0000 (+0200) Subject: Use existing macros (and fix error code). X-Git-Tag: v3.32~27 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ffceeb598e75af5ea0b1d9bb89d751af1e8bcc38 Use existing macros (and fix error code). --- diff --git a/src/smpi/bindings/smpi_pmpi_file.cpp b/src/smpi/bindings/smpi_pmpi_file.cpp index 1981ca571e..e8dfd51da4 100644 --- a/src/smpi/bindings/smpi_pmpi_file.cpp +++ b/src/smpi/bindings/smpi_pmpi_file.cpp @@ -264,8 +264,7 @@ int PMPI_File_write_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int } int PMPI_File_delete(const char *filename, MPI_Info info){ - if (filename == nullptr) - return MPI_ERR_FILE; + CHECK_NULL(1, MPI_ERR_FILE, filename) const SmpiBenchGuard suspend_bench; int ret = simgrid::smpi::File::del(filename, info); return ret; @@ -371,9 +370,7 @@ int PMPI_File_set_errhandler(MPI_File file, MPI_Errhandler errhandler){ } int PMPI_File_call_errhandler(MPI_File file,int errorcode){ - if (file == nullptr) { - return MPI_ERR_WIN; - } + CHECK_FILE(1, file) MPI_Errhandler err = file->errhandler(); err->call(file, errorcode); simgrid::smpi::Errhandler::unref(err);