From 800c5927e8dd9ef9f9544e22a5d2e2be853af962 Mon Sep 17 00:00:00 2001
From: Morris Jette <jette@schedmd.com>
Date: Mon, 30 Mar 2015 09:50:04 -0700
Subject: [PATCH] Correct plugin test logic for SPANK

---
 src/common/plugin.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/common/plugin.c b/src/common/plugin.c
index 91e8b140a28..a6d82834a53 100644
--- a/src/common/plugin.c
+++ b/src/common/plugin.c
@@ -140,13 +140,13 @@ plugin_peek( const char *fq_path,
 	version = (uint32_t *) dlsym(plug, PLUGIN_VERSION);
 	if (!version) {
 		verbose("%s: plugin_version symbol not defined", fq_path);
-	} else if ((*version != SLURM_VERSION_NUMBER) &&
-		   (!strcmp(type, "spank"))) {
+	} else if ((*version != SLURM_VERSION_NUMBER) && strcmp(type, "spank")){
+		/* NOTE: We could alternatly test just the MAJOR.MINOR values */
 		int plugin_major, plugin_minor, plugin_micro;
 		plugin_major = SLURM_VERSION_MAJOR(*version);
 		plugin_minor = SLURM_VERSION_MINOR(*version);
 		plugin_micro = SLURM_VERSION_MICRO(*version);
-		dlclose( plug );
+		dlclose(plug);
 		info("%s: Incompatible Slurm plugin version (%d.%d.%d)",
 		     fq_path, plugin_major, plugin_minor, plugin_micro);
 		return SLURM_ERROR;
@@ -204,8 +204,8 @@ plugin_load_from_file(plugin_handle_t *p, const char *fq_path)
 	version = (uint32_t *) dlsym(plug, PLUGIN_VERSION);
 	if (!version) {
 		verbose("%s: plugin_version symbol not defined", fq_path);
-	} else if ((*version != SLURM_VERSION_NUMBER) &&
-		   (!strcmp(type, "spank"))) {
+	} else if ((*version != SLURM_VERSION_NUMBER) && strcmp(type, "spank")){
+		/* NOTE: We could alternatly test just the MAJOR.MINOR values */
 		int plugin_major, plugin_minor, plugin_micro;
 		plugin_major = SLURM_VERSION_MAJOR(*version);
 		plugin_minor = SLURM_VERSION_MINOR(*version);
-- 
GitLab