projects
/
nbd.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use mktemp -d
[nbd.git]
/
simple_test
diff --git
a/simple_test
b/simple_test
index
a05a6a5
..
44191eb
100755
(executable)
--- a/
simple_test
+++ b/
simple_test
@@
-1,9
+1,10
@@
#!/bin/sh
# Yes, that's POSIX sh, not bash!
#!/bin/sh
# Yes, that's POSIX sh, not bash!
-tmpnam=`mktemp`
-conffile=${tmpnam}.conf
-pidfile=${tmpnam}.pid
+tmpdir=`mktemp -d`
+conffile=${tmpdir}/nbd.conf
+pidfile=${tmpdir}/nbd.pid
+tmpnam=${tmpdir}/nbd.dd
ulimit -c unlimited
ulimit -c unlimited
@@
-75,13
+76,12
@@
EOF
if [ -f ${pidfile} ]
then
kill `cat ${pidfile}`
if [ -f ${pidfile} ]
then
kill `cat ${pidfile}`
- rm -f ${pidfile}
else
kill $PID
fi
if [ -z "$2" ]
then
else
kill $PID
fi
if [ -z "$2" ]
then
- rm -f $tmpnam ${conffile}
+ rm -rf $tmpdir
fi
exit $retval
fi
fi
exit $retval
fi
@@
-156,13
+156,12
@@
esac
if [ -f ${pidfile} ]
then
kill `cat ${pidfile}`
if [ -f ${pidfile} ]
then
kill `cat ${pidfile}`
- rm -f ${pidfile}
else
kill $PID
fi
if [ -z "$2" ]
then
else
kill $PID
fi
if [ -z "$2" ]
then
- rm -f $tmpnam ${conffile}
+ rm -rf $tmpdir
fi
if [ $retval -ne 0 ]
then
fi
if [ $retval -ne 0 ]
then