Update of /cvsroot/oprofile/oprofile/utils
In directory sc8-pr-cvs1:/tmp/cvs-serv25336/utils
Modified Files:
opcontrol
Log Message:
2003-02-06 Will Cohen <wcohen@...>
* utils/opcontrol (do_dump): Do not exit if no daemon.
Index: opcontrol
===================================================================
RCS file: /cvsroot/oprofile/oprofile/utils/opcontrol,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- opcontrol 1 Feb 2003 21:47:47 -0000 1.18
+++ opcontrol 7 Feb 2003 15:00:18 -0000 1.19
@@ -395,6 +395,7 @@
--dump)
DUMP=yes
+ ONLY_DUMP=yes
;;
--stop)
@@ -781,18 +782,19 @@
}
+# do_dump
+# returns 0 if successful
+# returns 1 if the daemon is not running
do_dump() {
#make sure that the daemon is running
if test -e "$DIR/lock"; then
OPROFILED_PID=`cat $DIR/lock`
ps -p $OPROFILED_PID | grep $OPROFILED_PID > /dev/null
if [ "$?" -ne 0 ]; then
- echo "No daemon running" >& 2
- exit 1
+ return 1;
fi
else
- echo "No daemon running" >& 2
- exit 1
+ return 1;
fi
if test "$KERNEL_SUPPORT" = "yes"; then
@@ -814,6 +816,7 @@
echo 1 > $MOUNT/dump
fi
+ return 0;
}
@@ -903,7 +906,10 @@
fi
if test "$DUMP" = "yes"; then
- do_dump
+ if ! do_dump && test "$ONLY_DUMP" = "yes"; then
+ echo "No daemon running" >& 2
+ exit 1;
+ fi
fi
#FIXME this is a hack :(
|