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,
|
7275 | 7275 | FileDeviceDeleter() : id(-1) {} |
7276 | 7276 | ~FileDeviceDeleter() |
7277 | 7277 | { |
7278 | | KDiskDeviceManager::Default()->DeleteFileDevice(id); |
| 7278 | KDiskDeviceManager* ddm = KDiskDeviceManager::Default(); |
| 7279 | if (ddm) ddm->DeleteFileDevice(id); |
7279 | 7280 | } |
7280 | 7281 | |
7281 | 7282 | partition_id id; |
… |
… |
fs_unmount(char* path, dev_t mountID, uint32 flags, bool kernel)
|
7780 | 7781 | partition->SetVolumeID(-1); |
7781 | 7782 | partition->SetMountCookie(NULL); |
7782 | 7783 | |
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 | } |
7785 | 7788 | partition->Unregister(); |
7786 | 7789 | } |
7787 | 7790 | |