Splitted out return status to a new function.
Merge branch 'master' into no-bash

* master:
  Splitted out return status to a new function.