Ticket #10325: 0007-rootfs.cpp-Replace-undefined-behaviour-with-offsetof.patch

File 0007-rootfs.cpp-Replace-undefined-behaviour-with-offsetof.patch, 918 bytes (added by js, 7 years ago)
  • src/system/kernel/fs/rootfs.cpp

    From 6a84baa93fa22b2d9dd663fc11b94330e3667a1f Mon Sep 17 00:00:00 2001
    From: Jonathan Schleifer <js@webkeks.org>
    Date: Wed, 18 Dec 2013 00:29:08 +0100
    Subject: [PATCH] rootfs.cpp: Replace undefined behaviour with offsetof.
    
    ---
     src/system/kernel/fs/rootfs.cpp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/system/kernel/fs/rootfs.cpp b/src/system/kernel/fs/rootfs.cpp
    index 6f80a51..9c1db88 100644
    a b rootfs_mount(fs_volume* volume, const char* device, uint32 flags,  
    377377    rw_lock_init(&fs->lock, "rootfs");
    378378
    379379    fs->vnode_list_hash = hash_init(ROOTFS_HASH_SIZE,
    380         (addr_t)&vnode->all_next - (addr_t)vnode, &rootfs_vnode_compare_func,
     380        offsetof(rootfs_vnode, all_next), &rootfs_vnode_compare_func,
    381381        &rootfs_vnode_hash_func);
    382382    if (fs->vnode_list_hash == NULL) {
    383383        err = B_NO_MEMORY;