summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
96f412b)
reach the end of the partition
SCCS-vsn: sbin/savecore/savecore.c 5.2
#endif not lint
#ifndef lint
#endif not lint
#ifndef lint
-static char sccsid[] = "@(#)savecore.c 5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)savecore.c 5.2 (Berkeley) %G%";
Read(dumpfd, (char *)&word, sizeof word);
close(dumpfd);
if (Verbose && (word != dumpmag)) {
Read(dumpfd, (char *)&word, sizeof word);
close(dumpfd);
if (Verbose && (word != dumpmag)) {
- printf("dumplo = %d (%d bytes)\n", dumplo/512, dumplo);
+ printf("dumplo = %d (%d bytes)\n", dumplo/DEV_BSIZE, dumplo);
printf("magic number mismatch: %x != %x\n", word, dumpmag);
}
return (word == dumpmag);
printf("magic number mismatch: %x != %x\n", word, dumpmag);
}
return (word == dumpmag);
Read(kmem, (char *)&dumplo, sizeof (dumplo));
Lseek(kmem, (long)current_nl[X_DUMPMAG].n_value, 0);
Read(kmem, (char *)&dumpmag, sizeof (dumpmag));
Read(kmem, (char *)&dumplo, sizeof (dumplo));
Lseek(kmem, (long)current_nl[X_DUMPMAG].n_value, 0);
Read(kmem, (char *)&dumpmag, sizeof (dumpmag));
ddname = find_dev(dumpdev, S_IFBLK);
if ((fp = fdopen(kmem, "r")) == NULL) {
fprintf(stderr, "savecore: Couldn't fdopen kmem\n");
ddname = find_dev(dumpdev, S_IFBLK);
if ((fp = fdopen(kmem, "r")) == NULL) {
fprintf(stderr, "savecore: Couldn't fdopen kmem\n");
bounds);
while (dumpsize > 0) {
n = Read(ifd, cp, (dumpsize > 32 ? 32 : dumpsize) * NBPG);
bounds);
while (dumpsize > 0) {
n = Read(ifd, cp, (dumpsize > 32 ? 32 : dumpsize) * NBPG);
+ if (n == 0) {
+ printf("WARNING: core may be incomplete\n");
+ break;
+ }
Write(ofd, cp, n);
dumpsize -= n/NBPG;
}
Write(ofd, cp, n);
dumpsize -= n/NBPG;
}