]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
libceph: pull version from new version define
authorSage Weil <sage@newdream.net>
Fri, 18 Mar 2011 21:49:28 +0000 (14:49 -0700)
committerSage Weil <sage@newdream.net>
Fri, 18 Mar 2011 21:49:28 +0000 (14:49 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/libceph.cc

index c56cd93e328a2311f7d9439721c6919c751f40b3..19f09686dbc1db6acd449604ae59521b65e308e7 100644 (file)
@@ -11,6 +11,8 @@
 #include "msg/SimpleMessenger.h"
 #include "client/Client.h"
 
+#include "ceph_ver.h"
+
 /* ************* ************* ************* *************
  * C interface
  */
@@ -19,13 +21,13 @@ extern "C" const char *ceph_version(int *pmajor, int *pminor, int *ppatch)
 {
   int major, minor, patch;
 
-  sscanf(VERSION, "%d.%d.%d", &major, &minor, &patch);
+  int n = sscanf(CEPH_GIT_NICE_VER, "%d.%d.%d", &major, &minor, &patch);
   if (pmajor)
-    *pmajor = major;
+    *pmajor = (n >= 1) ? major : 0;
   if (pminor)
-    *pminor = minor;
+    *pminor = (n >= 2) ? minor : 0;
   if (ppatch)
-    *ppatch = patch;
+    *ppatch = (n >= 3) ? patch : 0;
   return VERSION;
 }