Skip to content

Commit 5e159fe

Browse files
committed
get_library_version: always use "X.Y.Z" version number format
Fix one last place where we would write only "X.Y" if Z was 0 (we now always write all three X, Y, Z values, even if Z is zero).
1 parent dd23187 commit 5e159fe

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

ompi/mpi/c/get_library_version.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
12-
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
12+
* Copyright (c) 2014-2015 Cisco Systems, Inc. All rights reserved.
1313
* $COPYRIGHT$
1414
*
1515
* Additional copyrights may follow
@@ -74,16 +74,11 @@ int MPI_Get_library_version(char *version, int *resultlen)
7474
len_left = sizeof(tmp);
7575
memset(tmp, 0, MPI_MAX_LIBRARY_VERSION_STRING);
7676

77-
snprintf(tmp, MPI_MAX_LIBRARY_VERSION_STRING, "Open MPI v%d.%d",
78-
OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION);
77+
snprintf(tmp, MPI_MAX_LIBRARY_VERSION_STRING, "Open MPI v%d.%d.%d",
78+
OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION, OMPI_RELEASE_VERSION);
7979
ptr += strlen(tmp);
8080
len_left -= strlen(tmp);
8181

82-
if (OMPI_RELEASE_VERSION > 0) {
83-
snprintf(ptr, len_left, ".%d", OMPI_RELEASE_VERSION);
84-
ptr = tmp + strlen(tmp);
85-
len_left = MPI_MAX_LIBRARY_VERSION_STRING - strlen(tmp);
86-
}
8782
if (NULL != OMPI_GREEK_VERSION && strlen(OMPI_GREEK_VERSION) > 0) {
8883
snprintf(ptr, len_left, "%s", OMPI_GREEK_VERSION);
8984
ptr = tmp + strlen(tmp);

0 commit comments

Comments
 (0)