savecore -z dumps core: linker or libz
Skip Ford
skip.ford at verizon.net
Thu Aug 12 06:44:29 PDT 2004
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
@@ -88,7 +88,7 @@
/* 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 *);
@@ -347,7 +347,7 @@
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 {
@@ -371,7 +371,7 @@
fclose(info);
syslog(LOG_NOTICE, "writing %score to %s",
- compress ? "compressed " : "", buf);
+ compress_core ? "compressed " : "", buf);
while (dumpsize > 0) {
wl = BUFFERSIZE;
@@ -387,7 +387,7 @@
nerr++;
goto closeall;
}
- if (compress) {
+ if (compress_core) {
nw = fwrite(buf, 1, wl, fp);
} else {
for (nw = 0; nw < nr; nw = he) {
@@ -515,7 +515,7 @@
force = 1;
break;
case 'z':
- compress = 1;
+ compress_core = 1;
break;
case '?':
default:
--
Skip
More information about the freebsd-current
mailing list