[Swift-commit] r4069 - SwiftApps/SwiftR/Swift/exec

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Tue Feb 8 09:13:36 CST 2011


Author: tga
Date: 2011-02-08 09:13:35 -0600 (Tue, 08 Feb 2011)
New Revision: 4069

Modified:
   SwiftApps/SwiftR/Swift/exec/start-swift
   SwiftApps/SwiftR/Swift/exec/start-swift-daemon
Log:
Check that directory creation went ok.


Modified: SwiftApps/SwiftR/Swift/exec/start-swift
===================================================================
--- SwiftApps/SwiftR/Swift/exec/start-swift	2011-02-08 14:58:03 UTC (rev 4068)
+++ SwiftApps/SwiftR/Swift/exec/start-swift	2011-02-08 15:13:35 UTC (rev 4069)
@@ -1,6 +1,6 @@
 #! /bin/bash
 
-#set -x
+set -x
 
 export TRAPEVENTS="EXIT 1 2 3 15"  # Signals and conditions to trap
 
@@ -417,6 +417,11 @@
 if [ "$workdir" = NONE ]
 then
     trundir=$(mktemp -d $rundir.XXXX) # FIXME: check success
+    if [ "$?" != "0" ]
+    then
+        echo "Could not create temporary directory under $tmp/$USER/SwiftR"
+        exit 1
+    fi
 else 
     echo Working in $workdir
     trundir=$workdir

Modified: SwiftApps/SwiftR/Swift/exec/start-swift-daemon
===================================================================
--- SwiftApps/SwiftR/Swift/exec/start-swift-daemon	2011-02-08 14:58:03 UTC (rev 4068)
+++ SwiftApps/SwiftR/Swift/exec/start-swift-daemon	2011-02-08 15:13:35 UTC (rev 4069)
@@ -10,8 +10,15 @@
 
 # Choose a working directory
 tmp=${SWIFTR_TMP:-/tmp}
-workdir=$(mktemp -d $tmp/$USER/SwiftR/swift.XXXX) # FIXME: check success
 
+mkdir -p $tmp/$USER/SwiftR
+workdir=$(mktemp -d $tmp/$USER/SwiftR/swift.XXXX) 
+if [ "$?" != "0" ]
+then
+    echo "Could not create temporary directory under $tmp/$USER/SwiftR"
+    exit 1
+fi
+
 # Start as detached daemon, with output going to stderr
 # Start up a subprocess with a new process group
 # childpid will be of form '[jobno] pid'




More information about the Swift-commit mailing list