savecore -z dumps core: linker or libz

From: Skip Ford <skip.ford_at_verizon.net>
Date: Thu, 12 Aug 2004 09:44:22 -0400
With sources from 36 hours ago, linking savecore produces:

/usr/bin/ld: Warning: size of symbol `compress' changed from 4 in savecore.o to 27 in /usr/lib/libz.a(compress.o)
/usr/bin/ld: Warning: type of symbol `compress' changed from 1 to 2 in /usr/lib/libz.a(compress.o)

'savecore -z' dumps core.  's/compress/compress_core//' as
included below works around the problem.

Index: sbin/savecore/savecore.c
===================================================================
RCS file: /cvs/ncvs/src/sbin/savecore/savecore.c,v
retrieving revision 1.68
diff -u -r1.68 savecore.c
--- sbin/savecore/savecore.c	28 Feb 2004 10:42:27 -0000	1.68
+++ sbin/savecore/savecore.c	12 Aug 2004 13:14:21 -0000
_at__at_ -88,7 +88,7 _at__at_
 /* The size of the buffer used for I/O. */
 #define	BUFFERSIZE	(1024*1024)
 
-int checkfor, compress, clear, force, keep, verbose;	/* flags */
+int checkfor, compress_core, clear, force, keep, verbose;	/* flags */
 int nfound, nsaved, nerr;			/* statistics */
 
 extern FILE *zopen(const char *, const char *);
_at__at_ -347,7 +347,7 _at__at_
 		goto closefd;
 	}
 	oumask = umask(S_IRWXG|S_IRWXO); /* Restrict access to the core file.*/
-	if (compress) {
+	if (compress_core) {
 		sprintf(buf, "vmcore.%d.gz", bounds);
 		fp = zopen(buf, "w");
 	} else {
_at__at_ -371,7 +371,7 _at__at_
 	fclose(info);
 
 	syslog(LOG_NOTICE, "writing %score to %s",
-	    compress ? "compressed " : "", buf);
+	    compress_core ? "compressed " : "", buf);
 
 	while (dumpsize > 0) {
 		wl = BUFFERSIZE;
_at__at_ -387,7 +387,7 _at__at_
 			nerr++;
 			goto closeall;
 		}
-		if (compress) {
+		if (compress_core) {
 			nw = fwrite(buf, 1, wl, fp);
 		} else {
 			for (nw = 0; nw < nr; nw = he) {
_at__at_ -515,7 +515,7 _at__at_
 			force = 1;
 			break;
 		case 'z':
-			compress = 1;
+			compress_core = 1;
 			break;
 		case '?':
 		default:

-- 
Skip
Received on Thu Aug 12 2004 - 11:44:29 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:05 UTC