From 98b6dcc99003806dbfd8c232c750e7ebce82029e Mon Sep 17 00:00:00 2001
From: Puck Meerburg <puck@puckipedia.nl>
Date: Sun, 22 Dec 2013 22:41:42 +0000
Subject: [PATCH] BPartition: Move dev_t return value to an optional parameter
---
headers/private/storage/Partition.h | 5 +++--
src/kits/storage/disk_device/Partition.cpp | 14 +++++++++-----
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/headers/private/storage/Partition.h b/headers/private/storage/Partition.h
index 2f897c6..5ef98d0 100644
a
|
b
|
public:
|
68 | 68 | type_code* _type) const; |
69 | 69 | status_t GetMountPoint(BPath* mountPoint) const; |
70 | 70 | |
71 | | dev_t Mount(const char* mountPoint = NULL, |
| 71 | status_t Mount(const char* mountPoint = NULL, |
72 | 72 | uint32 mountFlags = 0, |
73 | | const char* parameters = NULL); |
| 73 | const char* parameters = NULL, |
| 74 | dev_t* devicePointer = NULL); |
74 | 75 | status_t Unmount(uint32 unmountFlags = 0); |
75 | 76 | |
76 | 77 | // Hierarchy Info |
diff --git a/src/kits/storage/disk_device/Partition.cpp b/src/kits/storage/disk_device/Partition.cpp
index c1bb3d6..8a6cce8 100644
a
|
b
|
BPartition::GetMountPoint(BPath* mountPoint) const
|
518 | 518 | \param mountFlags Currently only \c B_MOUNT_READ_ONLY is defined, which |
519 | 519 | forces the volume to be mounted read-only. |
520 | 520 | \param parameters File system specific mount parameters. |
| 521 | \param devicePointer Reference to the mounted filesystem for the programs |
| 522 | interested in it |
521 | 523 | \return \c B_OK, if everything went fine, another error code otherwise. |
522 | 524 | */ |
523 | | dev_t |
| 525 | status_t |
524 | 526 | BPartition::Mount(const char* mountPoint, uint32 mountFlags, |
525 | | const char* parameters) |
| 527 | const char* parameters, dev_t* devicePointer) |
526 | 528 | { |
527 | 529 | if (IsMounted() || !ContainsFileSystem()) |
528 | 530 | return B_BAD_VALUE; |
… |
… |
BPartition::Mount(const char* mountPoint, uint32 mountFlags,
|
569 | 571 | } |
570 | 572 | |
571 | 573 | // update object, if successful |
572 | | if (device >= 0) |
| 574 | if (device >= 0) { |
573 | 575 | error = Device()->Update(); |
574 | | |
575 | | return device; |
| 576 | *devicePointer = device; |
| 577 | return error; |
| 578 | } |
| 579 | return B_ERROR; |
576 | 580 | } |
577 | 581 | |
578 | 582 | |