f2fs-tools: show versions if exist
authorJaegeuk Kim <jaegeuk@kernel.org>
Fri, 16 Nov 2018 01:38:01 +0000 (17:38 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 21 Nov 2018 19:38:23 +0000 (11:38 -0800)
If it's not defined, we need to skip to show the definition.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
include/f2fs_fs.h

index cdf54e5..65cc8fd 100644 (file)
@@ -1326,7 +1326,11 @@ static inline int is_qf_ino(struct f2fs_super_block *sb, nid_t ino)
 
 static inline void show_version(const char *prog)
 {
+#if defined(F2FS_TOOLS_VERSION) && defined(F2FS_TOOLS_DATE)
        MSG(0, "%s %s (%s)\n", prog, F2FS_TOOLS_VERSION, F2FS_TOOLS_DATE);
+#else
+       MSG(0, "%s -- version not supported\n", prog);
+#endif
 }
 
 struct feature {