]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
r8647: Re-instate fix from svn 7079, which was removed in svn 7497.
authorSean Hefty <sean.hefty@intel.com>
Mon, 24 Jul 2006 17:29:56 +0000 (17:29 +0000)
committerSean Hefty <sean.hefty@intel.com>
Mon, 24 Jul 2006 17:29:56 +0000 (17:29 +0000)
On kernels 2.6.9 an older, class/misc does not exist.  To support kernel
backports, if we are unable to locate rdma_cm/abi_version, assume the
latest version.  If we're wrong, we'll fail later in the code calling into
the ABI.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/cma.c

index c64d2f3b8aeb8b5a090133b66bd03a9ab236a593..19f84be0b08dfa15788b07e53c2b6d36234b43f5 100644 (file)
--- a/src/cma.c
+++ b/src/cma.c
@@ -144,8 +144,14 @@ static int check_abi_version(void)
        if (ibv_read_sysfs_file(ibv_get_sysfs_path(),
                                "class/misc/rdma_cm/abi_version",
                                value, sizeof value) < 0) {
+               /*
+                * Older version of Linux do not have class/misc.  To support
+                * backports, assume the most recent version of the ABI.  If
+                * we're wrong, we'll simply fail later when calling the ABI.
+                */
                fprintf(stderr, "librdmacm: couldn't read ABI version.\n");
-               return -1;
+               fprintf(stderr, "librdmacm: assuming: %d\n", abi_ver);
+               return 0;
        }
 
        abi_ver = strtol(value, NULL, 10);