Ticket #13285: 0001-vfs.cpp-Fix-gcc6-crash.patch

File 0001-vfs.cpp-Fix-gcc6-crash.patch, 1.2 KB (added by mt, 7 years ago)
  • src/system/kernel/fs/vfs.cpp

    From 356d02919ce7b798563a9d998c4f213e67788277 Mon Sep 17 00:00:00 2001
    From: Murai Takashi <tmurai01@gmail.com>
    Date: Mon, 10 Jul 2017 21:56:22 +0900
    Subject: [PATCH] vfs.cpp: Fix gcc6 crash.
    
    ---
     src/system/kernel/fs/vfs.cpp | 9 ++++++---
     1 file changed, 6 insertions(+), 3 deletions(-)
    
    diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp
    index ea47773..54a60b2 100644
    a b fs_mount(char* path, const char* device, const char* fsName, uint32 flags,  
    72757275        FileDeviceDeleter() : id(-1) {}
    72767276        ~FileDeviceDeleter()
    72777277        {
    7278             KDiskDeviceManager::Default()->DeleteFileDevice(id);
     7278            KDiskDeviceManager* ddm = KDiskDeviceManager::Default();
     7279            if (ddm) ddm->DeleteFileDevice(id);
    72797280        }
    72807281
    72817282        partition_id id;
    fs_unmount(char* path, dev_t mountID, uint32 flags, bool kernel)  
    77807781        partition->SetVolumeID(-1);
    77817782        partition->SetMountCookie(NULL);
    77827783
    7783         if (mount->owns_file_device)
    7784             KDiskDeviceManager::Default()->DeleteFileDevice(partition->ID());
     7784        if (mount->owns_file_device) {
     7785            KDiskDeviceManager* ddm = KDiskDeviceManager::Default();
     7786            if (ddm) ddm->DeleteFileDevice(partition->ID());
     7787        }
    77857788        partition->Unregister();
    77867789    }
    77877790