Date: Fri, 28 Feb 2020 07:47:58 +0000 (UTC) From: Peter Holm <pho@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r358424 - user/pho/stress2/misc Message-ID: <202002280747.01S7lwSk077857@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pho Date: Fri Feb 28 07:47:57 2020 New Revision: 358424 URL: https://svnweb.freebsd.org/changeset/base/358424 Log: Return fsck error code. Added kill(2) error handling. Modified: user/pho/stress2/misc/rename10.sh Modified: user/pho/stress2/misc/rename10.sh ============================================================================== --- user/pho/stress2/misc/rename10.sh Fri Feb 28 07:46:35 2020 (r358423) +++ user/pho/stress2/misc/rename10.sh Fri Feb 28 07:47:57 2020 (r358424) @@ -52,7 +52,9 @@ newfs $newfs_flags md${mdstart}$part > /dev/null mount /dev/md${mdstart}$part $mntpoint avail=`df -k $mntpoint | tail -1 | awk '{print $4}'` -(cd $mntpoint; /tmp/rename10) +cd $mntpoint +/tmp/rename10; s=$? +cd $here for i in `jot 3`; do sync @@ -72,10 +74,10 @@ while mount | grep "on $mntpoint " | grep -q /dev/md; [ $n -gt 5 ] && { umount -f $mntpoint; break; } done -checkfs /dev/md${mdstart}$part +checkfs /dev/md${mdstart}$part || s=$? rm -f /tmp/rename10 mdconfig -d -u $mdstart -exit 0 +exit $s EOF #include <err.h> #include <fcntl.h> @@ -171,8 +173,10 @@ main() { renamer(); for (i = 0; i < PARALLEL; i++) { - kill(pids[i], SIGINT); - kill(spids[i], SIGINT); + if (kill(pids[i], SIGINT) == -1) + err(1, "kill(%d)", pids[i]); + if (kill(spids[i], SIGINT) == -1) + err(1, "kill(%d)", spids[i]); } for (i = 0; i < PARALLEL * 2; i++) wait(NULL);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002280747.01S7lwSk077857>