Merge tag 'kbuild-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[linux-block.git] / scripts / mkcompile_h
index 959199c3147ec79e2797e0c87cf47b0e03723a25..87f1fc9801d7330e86bfd39f9077c899ba8589cc 100755 (executable)
@@ -28,12 +28,7 @@ LC_ALL=C
 export LC_ALL
 
 if [ -z "$KBUILD_BUILD_VERSION" ]; then
-       if [ -r .version ]; then
-               VERSION=`cat .version`
-       else
-               VERSION=0
-               echo 0 > .version
-       fi
+       VERSION=$(cat .version 2>/dev/null || echo 1)
 else
        VERSION=$KBUILD_BUILD_VERSION
 fi