DragonFly BSD
DragonFly submit List (threaded) for 2005-12
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: savecore -z patch


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Thu, 15 Dec 2005 19:07:01 +0100

On 15.12.2005, at 17:58, Joe Talbott wrote:
savecore -z causes an illegal seek error, Here's a patch borrowed
from here:

freebsd-4's changes attached, if nobody beats me to it i'll commit it tonight (unless i forget).


cheers
  simon

PS: nice to find out with <http://oly.corecode.ath.cx/~corecode/cgi-bin/crosscgi.py? sourceid=33693&cmd=detail>

--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \
Changeset for FreeBSD src/sbin/savecore/savecore.c 1.28.2.14 by maxim
o MFC a part of rev. 1.59: do not ever try to write a sparse files with
-z (compress the core dump and kernel) flag.

PR:		bin/36136
Submitted by:	Dorr H. Clark, Dmitry Frolov

Index: src/sbin/savecore/savecore.c
diff -u src/sbin/savecore/savecore.c:1.28.2.13 src/sbin/savecore/savecore.c:1.28.2.14
--- src/sbin/savecore/savecore.c:1.28.2.13	Sun Apr  7 23:17:50 2002
+++ src/sbin/savecore/savecore.c	Wed Jan  5 10:14:34 2005
@@ -42,7 +42,7 @@
 static char sccsid[] = "@(#)savecore.c	8.3 (Berkeley) 1/2/94";
 #endif
 static const char rcsid[] =
-  "$FreeBSD: src/sbin/savecore/savecore.c,v 1.28.2.13 2002/04/07 21:17:50 asmodai Exp $";
+  "$FreeBSD: src/sbin/savecore/savecore.c,v 1.28.2.14 2005/01/05 09:14:34 maxim Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -428,6 +428,9 @@
 				syslog(LOG_ERR, "%s: %m", ddname);
 			goto err2;
 		}
+		if (compress) {
+			nw = fwrite(buf, 1, nr, fp);
+		} else {
 		for (nw = 0; nw < nr; nw = he) {
 			/* find a contiguous block of zeroes */
 			for (hs = nw; hs < nr; hs += BLOCKSIZE) {
@@ -463,6 +466,7 @@
 			if (he > hs)
 				if (fseeko(fp, he - hs, SEEK_CUR) == -1)
 					break;
+			}
 		}
 		if (nw != nr) {
 			syslog(LOG_ERR, "%s: %m", path);

Attachment: PGP.sig
Description: This is a digitally signed message part



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]