Lines 264-285
foreach_chunk(callback_t cb, void *arg)
Link Here
|
264 |
mdp = md_pa_next(mdp); |
264 |
mdp = md_pa_next(mdp); |
265 |
} |
265 |
} |
266 |
return (seqnr); |
266 |
return (seqnr); |
267 |
} |
267 |
} |
268 |
|
268 |
|
269 |
void |
269 |
int |
270 |
dumpsys(struct dumperinfo *di) |
270 |
dumpsys(struct dumperinfo *di) |
271 |
{ |
271 |
{ |
272 |
Elf_Ehdr ehdr; |
272 |
Elf_Ehdr ehdr; |
273 |
uint64_t dumpsize; |
273 |
uint64_t dumpsize; |
274 |
off_t hdrgap; |
274 |
off_t hdrgap; |
275 |
size_t hdrsz; |
275 |
size_t hdrsz; |
276 |
int error; |
276 |
int error; |
277 |
|
277 |
|
278 |
if (do_minidump) { |
278 |
if (do_minidump) { |
279 |
minidumpsys(di); |
279 |
minidumpsys(di); |
280 |
return; |
280 |
return (0); |
281 |
} |
281 |
} |
282 |
bzero(&ehdr, sizeof(ehdr)); |
282 |
bzero(&ehdr, sizeof(ehdr)); |
283 |
ehdr.e_ident[EI_MAG0] = ELFMAG0; |
283 |
ehdr.e_ident[EI_MAG0] = ELFMAG0; |
284 |
ehdr.e_ident[EI_MAG1] = ELFMAG1; |
284 |
ehdr.e_ident[EI_MAG1] = ELFMAG1; |
285 |
ehdr.e_ident[EI_MAG2] = ELFMAG2; |
285 |
ehdr.e_ident[EI_MAG2] = ELFMAG2; |
Lines 361-371
dumpsys(struct dumperinfo *di)
Link Here
|
361 |
goto fail; |
361 |
goto fail; |
362 |
|
362 |
|
363 |
/* Signal completion, signoff and exit stage left. */ |
363 |
/* Signal completion, signoff and exit stage left. */ |
364 |
dump_write(di, NULL, 0, 0, 0); |
364 |
dump_write(di, NULL, 0, 0, 0); |
365 |
printf("\nDump complete\n"); |
365 |
printf("\nDump complete\n"); |
366 |
return; |
366 |
return (0); |
367 |
|
367 |
|
368 |
fail: |
368 |
fail: |
369 |
if (error < 0) |
369 |
if (error < 0) |
370 |
error = -error; |
370 |
error = -error; |
371 |
|
371 |
|
Lines 373-378
dumpsys(struct dumperinfo *di)
Link Here
|
373 |
printf("\nDump aborted\n"); |
373 |
printf("\nDump aborted\n"); |
374 |
else if (error == ENOSPC) |
374 |
else if (error == ENOSPC) |
375 |
printf("\nDump failed. Partition too small.\n"); |
375 |
printf("\nDump failed. Partition too small.\n"); |
376 |
else |
376 |
else |
377 |
printf("\n** DUMP FAILED (ERROR %d) **\n", error); |
377 |
printf("\n** DUMP FAILED (ERROR %d) **\n", error); |
|
|
378 |
return (error); |
378 |
} |
379 |
} |