Ticket #9672: fixv4.patch

File fixv4.patch, 2.3 KB (added by puckipedia, 10 years ago)

Fix

  • headers/private/storage/Partition.h

    From 7ae0d342bed519834bad1ac79f4904bcc9a678a7 Mon Sep 17 00:00:00 2001
    From: Puck Meerburg <puck@puckipedia.nl>
    Date: Thu, 19 Dec 2013 21:14:56 +0000
    Subject: [PATCH] BPartition: Move dev_t return value to an optional parameter
     (fixes small issues)
    
    ---
     headers/private/storage/Partition.h        |  5 +++--
     src/kits/storage/disk_device/Partition.cpp | 17 ++++++++++++-----
     2 files changed, 15 insertions(+), 7 deletions(-)
    
    diff --git a/headers/private/storage/Partition.h b/headers/private/storage/Partition.h
    index 2f897c6..5ef98d0 100644
    a b public:  
    6868                                    type_code* _type) const;
    6969            status_t            GetMountPoint(BPath* mountPoint) const;
    7070
    71             dev_t               Mount(const char* mountPoint = NULL,
     71            status_t            Mount(const char* mountPoint = NULL,
    7272                                    uint32 mountFlags = 0,
    73                                     const char* parameters = NULL);
     73                                    const char* parameters = NULL,
     74                                    dev_t* devicePointer = NULL);
    7475            status_t            Unmount(uint32 unmountFlags = 0);
    7576
    7677    // Hierarchy Info
  • src/kits/storage/disk_device/Partition.cpp

    diff --git a/src/kits/storage/disk_device/Partition.cpp b/src/kits/storage/disk_device/Partition.cpp
    index c1bb3d6..87d884d 100644
    a b BPartition::GetMountPoint(BPath* mountPoint) const  
    518518    \param mountFlags Currently only \c B_MOUNT_READ_ONLY is defined, which
    519519           forces the volume to be mounted read-only.
    520520    \param parameters File system specific mount parameters.
     521    \param devicePointer Reference to the mounted filesystem for the programs
     522            interested in it
    521523    \return \c B_OK, if everything went fine, another error code otherwise.
    522524*/
    523 dev_t
     525status_t
    524526BPartition::Mount(const char* mountPoint, uint32 mountFlags,
    525     const char* parameters)
     527    const char* parameters, dev_t* devicePointer)
    526528{
    527529    if (IsMounted() || !ContainsFileSystem())
    528530        return B_BAD_VALUE;
    BPartition::Mount(const char* mountPoint, uint32 mountFlags,  
    568570        rmdir(mountPoint);
    569571    }
    570572
     573    // Update reference to device
     574    if(devicePointer != NULL)
     575        *devicePointer = device;
     576
    571577    // update object, if successful
    572     if (device >= 0)
     578    if (device >= 0) {
    573579        error = Device()->Update();
    574 
    575     return device;
     580        return error;
     581    }
     582    return B_ERROR;
    576583}
    577584
    578585