[prev in list] [next in list] [prev in thread] [next in thread] 

List:       oprofile-commits
Subject:    [oprof-cvs] CVS: oprofile/utils opcontrol,1.107,1.108
From:       Philippe Elie <phil_e () users ! sourceforge ! net>
Date:       2004-03-04 5:22:35
Message-ID: E1AylJb-0005DV-FS () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/oprofile/oprofile/utils
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19829/utils

Modified Files:
	opcontrol 
Log Message:
opcontrol: tweak a bit error message

Index: opcontrol
===================================================================
RCS file: /cvsroot/oprofile/oprofile/utils/opcontrol,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -p -d -r1.107 -r1.108
--- opcontrol	3 Mar 2004 20:09:17 -0000	1.107
+++ opcontrol	4 Mar 2004 05:22:33 -0000	1.108
@@ -1068,13 +1068,14 @@ do_start()
 # do_dump_data
 # returns 0 if successful
 # returns 1 if the daemon is unable to dump data
+# exit 1 if we need to be root to dump
 do_dump_data()
 {
 	# make sure that the daemon is not dead and gone
 	if test -e "$DIR/lock"; then
 		OPROFILED_PID=`cat $DIR/lock`
 		if test ! -d "/proc/$OPROFILED_PID"; then
-			echo "dump fail: either daemon died during last run or dies during dump" >&2
+			echo "dump fail: daemon died during last run ?" >&2
 			return 1;
 		fi
 	else
@@ -1084,11 +1085,13 @@ do_dump_data()
 	if test "$KERNEL_SUPPORT" = "yes"; then
 		# find current time
 		TMPFILE=`mktemp /tmp/oprofile.XXXXXX` || exit 1
-		echo 1 > $MOUNT/dump
-		if test "$?" -ne 0; then
-			echo "Unable to write to $MOUNT/dump" >&2
-			return 1
+		if ! test -w $MOUNT/dump; then
+			if test "$UID" != "0"; then
+				echo "You must be root to dump with this kernel version"
+				exit 1
+			fi
 		fi
+		echo 1 > $MOUNT/dump
 		# loop until there is a file to check and 
 		# the modification data of $MOUNT/dump after TMPFILE
 		while [ \( ! -e "$DIR/complete_dump" \) -o \( "$TMPFILE" -nt "$DIR/complete_dump" \) ]



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Oprofile-commits mailing list
Oprofile-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic