VirtualBox

Changeset 33837 in vbox for trunk/src


Ignore:
Timestamp:
Nov 8, 2010 1:28:12 PM (14 years ago)
Author:
vboxsync
Message:

Solaris build fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp

    r33834 r33837  
    3333#include <grp.h>
    3434#include <sys/mount.h>
    35 #include <mntent.h>
    36 #include <paths.h>
    3735#ifdef RT_OS_SOLARIS
    38 #include <sys/vfs.h>
     36# include <sys/vfs.h>
     37# include <sys/mnttab.h>
     38#else
     39# include <mntent.h>
     40# include <paths.h>
    3941#endif
    4042#include <unistd.h>
     
    5052#endif
    5153
     54#ifndef _PATH_MOUNTED
     55 #define _PATH_MOUNTED "/etc/mtab"
     56#endif
     57
    5258/*******************************************************************************
    5359*   Global Variables                                                           *
     
    8793
    8894
    89 static bool VBoxServiceAutoMountShareIsMounted(const char *pszShare, 
     95static bool VBoxServiceAutoMountShareIsMounted(const char *pszShare,
    9096                                               char *pszMountPoint, size_t cbMountPoint)
    9197{
     
    109115            if (!RTStrICmp(pMntEnt->mnt_fsname, pszShare))
    110116            {
    111                 fMounted = RTStrPrintf(pszMountPoint, cbMountPoint, "%s", pMntEnt->mnt_dir) 
    112                          ? true : false;               
     117                fMounted = RTStrPrintf(pszMountPoint, cbMountPoint, "%s", pMntEnt->mnt_dir)
     118                         ? true : false;
    113119                break;
    114             }               
    115         }       
     120            }
     121        }
    116122        endmntent(pFh);
    117123    }
     
    131137        r = umount(pszMountPoint);
    132138        if (r == 0)
    133             break;               
     139            break;
    134140        RTThreadSleep(5000); /* Wait a while ... */
    135141    }
    136142    if (r == -1)
    137143        rc = RTErrConvertFromErrno(errno);
    138     return rc;       
     144    return rc;
    139145}
    140146
     
    177183    int rc;
    178184    char szAlreadyMountedTo[RTPATH_MAX];
    179     /* If a Shared Folder already is mounted but not to our desired mount point, 
     185    /* If a Shared Folder already is mounted but not to our desired mount point,
    180186     * do an unmount first! */
    181187    if (   VBoxServiceAutoMountShareIsMounted(pszShareName, szAlreadyMountedTo, sizeof(szAlreadyMountedTo))
    182188        && RTStrICmp(pszMountPoint, szAlreadyMountedTo))
    183189    {
    184         VBoxServiceVerbose(3, "VBoxServiceAutoMountWorker: Shared folder \"%s\" already mounted to \"%s\", unmounting ...\n", 
     190        VBoxServiceVerbose(3, "VBoxServiceAutoMountWorker: Shared folder \"%s\" already mounted to \"%s\", unmounting ...\n",
    185191                           pszShareName, szAlreadyMountedTo);
    186192        rc = VBoxServiceAutoMountUnmount(szAlreadyMountedTo);
     
    315321                        VBoxServiceVerbose(0, "VBoxServiceAutoMountWorker: Shared folder \"%s\" already is mounted!\n", pszShareName);
    316322                        /* Ignore this error! */
    317                         break;                                         
     323                        break;
    318324                    case EBUSY:
    319325                        /* Ignore these errors! */
     
    325331                        rc = RTErrConvertFromErrno(errno);
    326332                        break;
    327                 }               
     333                }
    328334            }
    329335        }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette