Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (7 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/util-linux/volume_id/hfs.c

    r2725 r3232  
    132132#define HFSPLUS_POR_CNID        1
    133133
     134static void FAST_FUNC hfs_set_uuid(struct volume_id *id, const uint8_t *hfs_id)
     135{
     136#define hfs_id_len 8
     137    md5_ctx_t md5c;
     138    uint8_t uuid[16];
     139    unsigned i;
     140
     141    for (i = 0; i < hfs_id_len; i++)
     142        if (hfs_id[i] != 0)
     143            goto do_md5;
     144    return;
     145 do_md5:
     146    md5_begin(&md5c);
     147    md5_hash(&md5c, "\263\342\17\71\362\222\21\326\227\244\0\60\145\103\354\254", 16);
     148    md5_hash(&md5c, hfs_id, hfs_id_len);
     149    md5_end(&md5c, uuid);
     150    uuid[6] = 0x30 | (uuid[6] & 0x0f);
     151    uuid[8] = 0x80 | (uuid[8] & 0x3f);
     152    volume_id_set_uuid(id, uuid, UUID_DCE);
     153}
     154
    134155int FAST_FUNC volume_id_probe_hfs_hfsplus(struct volume_id *id /*,uint64_t off*/)
    135156{
     
    194215    }
    195216
    196     volume_id_set_uuid(id, hfs->finder_info.id, UUID_HFS);
     217    hfs_set_uuid(id, hfs->finder_info.id);
    197218//  volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
    198 //  id->type = "hfs";
     219    IF_FEATURE_BLKID_TYPE(id->type = "hfs";)
    199220
    200221    return 0;
     
    208229
    209230 hfsplus:
    210     volume_id_set_uuid(id, hfsplus->finder_info.id, UUID_HFS);
     231    hfs_set_uuid(id, hfsplus->finder_info.id);
    211232
    212233    blocksize = be32_to_cpu(hfsplus->blocksize);
     
    287308 found:
    288309//  volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
    289 //  id->type = "hfsplus";
     310    IF_FEATURE_BLKID_TYPE(id->type = "hfsplus";)
    290311
    291312    return 0;
Note: See TracChangeset for help on using the changeset viewer.