Changeset View
Changeset View
Standalone View
Standalone View
sys/ddb/db_textdump.c
Show First 20 Lines • Show All 242 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
if (textdump_error) | if (textdump_error) | ||||
return (textdump_error); | return (textdump_error); | ||||
if (offset + TEXTDUMP_BLOCKSIZE > di->mediasize) | if (offset + TEXTDUMP_BLOCKSIZE > di->mediasize) | ||||
return (EIO); | return (EIO); | ||||
if (offset < SIZEOF_METADATA) | if (offset < SIZEOF_METADATA) | ||||
return (ENOSPC); | return (ENOSPC); | ||||
textdump_error = dump_write(di, buffer, 0, offset + di->mediaoffset, | textdump_error = dump_write(di, buffer, offset + di->mediaoffset, | ||||
TEXTDUMP_BLOCKSIZE); | TEXTDUMP_BLOCKSIZE); | ||||
if (textdump_error) | if (textdump_error) | ||||
printf("textdump_writeblock: offset %jd, error %d\n", (intmax_t)offset, | printf("textdump_writeblock: offset %jd, error %d\n", (intmax_t)offset, | ||||
textdump_error); | textdump_error); | ||||
return (textdump_error); | return (textdump_error); | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 236 Lines • ▼ Show 20 Lines | #endif | ||||
(void)textdump_writenextblock(di, (char *)&kdh); | (void)textdump_writenextblock(di, (char *)&kdh); | ||||
textdump_restoreoff(trailer_offset); | textdump_restoreoff(trailer_offset); | ||||
(void)textdump_writenextblock(di, (char *)&kdh); | (void)textdump_writenextblock(di, (char *)&kdh); | ||||
/* | /* | ||||
* Terminate the dump, report any errors, and clear the pending flag. | * Terminate the dump, report any errors, and clear the pending flag. | ||||
*/ | */ | ||||
if (textdump_error == 0) | if (textdump_error == 0) | ||||
(void)dump_write(di, NULL, 0, 0, 0); | (void)dump_write(di, NULL, 0, 0); | ||||
if (textdump_error == ENOSPC) | if (textdump_error == ENOSPC) | ||||
printf("Textdump: Insufficient space on dump partition\n"); | printf("Textdump: Insufficient space on dump partition\n"); | ||||
else if (textdump_error != 0) | else if (textdump_error != 0) | ||||
printf("Textdump: Error %d writing dump\n", textdump_error); | printf("Textdump: Error %d writing dump\n", textdump_error); | ||||
else | else | ||||
printf("Textdump complete.\n"); | printf("Textdump complete.\n"); | ||||
textdump_pending = 0; | textdump_pending = 0; | ||||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |