]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
util/dovecot-sysreport --core: Check gdb existence earlier
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 1 Apr 2021 11:12:14 +0000 (14:12 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 7 May 2021 19:31:00 +0000 (19:31 +0000)
Simplifies the next commit.

src/util/dovecot-sysreport

index da3b254c657e78e213707c69b0cba5e17293be2b..63ef57e4e48723f5902afc4294d1f69df1465d30 100755 (executable)
@@ -41,6 +41,12 @@ while (( "$#" )); do
 
     -o|--core)
 
+      gdb=`which gdb`
+      if [ "$gdb" = "" ]; then
+        echo "gdb not found"
+        exit 1
+      fi
+
       if [[ "$#" -lt 2 ]] ; then
         echo "Usage: $0 $1 [<binary>] <core>"
         exit 1
@@ -72,12 +78,6 @@ while (( "$#" )); do
         exit 1
       fi
 
-      gdb=`which gdb`
-      if [ "$gdb" = "" ]; then
-        echo "gdb not found"
-        exit 1
-      fi
-
       echo "gathering core file dependencies..."
       core_files=$((echo "info shared"; sleep 1) | $gdb $binary $core | grep '^0x.*/' | sed 's,^[^/]*,,')
       cp $core $SRTEMP