From f1f28ba81558ce2b2ee07ae29b9a214a27310c57 Mon Sep 17 00:00:00 2001
From: Jonathan Hanks <jonathan.hanks@ligo.org>
Date: Tue, 19 Dec 2017 01:32:15 +0000
Subject: [PATCH] Forward port of r4596. Check env variables at startup to
 avoid a segfault in dataviewer.

Fix a segfault in dataviewer that happens with the LIGONDSIP variable
is not set. The updated script prints an error message and aborts.


git-svn-id: https://redoubt.ligo-wa.caltech.edu/svn/advLigoRTS/trunk@4599 6dcd42c9-f523-4c6d-aada-af552506706e
---
 src/dv/dataviewer.sh.cmake | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/dv/dataviewer.sh.cmake b/src/dv/dataviewer.sh.cmake
index 23fd10aa1..849854ebf 100644
--- a/src/dv/dataviewer.sh.cmake
+++ b/src/dv/dataviewer.sh.cmake
@@ -11,6 +11,10 @@ else
 fi
 export GRACE_HOME
 export LANG=C
+if [ -z "${LIGONDSIP}" ]; then
+    echo "Your environment is not setup.  Plese set LIGONDSIP"
+    exit 1
+fi
 PATH=${PATH}:${GRACE_HOME}/bin
 $DVPATH/dv -s ${LIGONDSIP} -a $$ -b $DVPATH $*
 /bin/rm -f -r /tmp/$$DC
-- 
GitLab