Browse files

Low: pgsql: remove an unnecessary code

  • Loading branch information...
1 parent bfa015c commit d975a137d8a49998ffa7ba7a93b3c5816be9c820 @t-matsuo committed Apr 24, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 heartbeat/pgsql
@@ -1474,8 +1474,7 @@ exec_func_with_timeout() {
wait $func_pid
- rc=$?
- return $rc
+ return $?
is_node_online() {

3 comments on commit d975a13

I think Dejan meant that you can remove a whole line of "return $?" at the end of functions.

This comment is also saying the same.


t-matsuo replied Apr 27, 2012

Do you mean that it dosen't need the log of command's failure ?

And the return value of is_node_online() is used, so It desn't work well if it's removed.

Even if you removed "return $?", the function does return the exit code of the last command as same as before.
Nothing would be changed. It's just redundant in those cases.

But I personally think it's just a matter of coding style, and it would be ok if you prefer to always write the return explicitly.
Not all RAs conform to the same style regarding to this anyway (IPaddr2 also uses a similar return for example).

Please sign in to comment.