On 16 November 2014 10:59, Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> wrote: > On 11/15/2014 08:41 PM, jessica.l.hamilton@xxxxxxxxx wrote: >> >> +Volume::WriteSuperBlock(bool initializing) >> +{ >> + if (initializing) { >> + const char emptySector[512] = { 0 }; >> + // also erase the first block, otherwise we risk >> mis-identifying >> + // the file system later (e.g. NTFS is identified by >> sector 0). >> + if (write_pos(fDevice, 0, emptySector, 512) != 512) >> + return B_IO_ERROR; >> + } > > > Please move that into its own function; there is no need to clobber this > one. Besides, that part is not part of the super block, anyway. Instead of making more needless commit noise, does the attached patch look correct? Also, I notice the existing code doesn't check for errors for the last handful of functions. As such, I haven't added error checking for the call to _PreparePartition(), unless these other function calls should be addressed to also check the return values. Jessica
Attachment:
0001-bfs-minor-refactoring-no-functional-change-intended.patch
Description: Binary data