VirtualBox

Changeset 1089 in kBuild


Ignore:
Timestamp:
Sep 5, 2007 8:50:59 PM (17 years ago)
Author:
bird
Message:

flock is BSD, use flock on Solaris.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kObjCache/kObjCache.c

    r1087 r1089  
    33703370    if (!LockFileEx((HANDLE)_get_osfhandle(pCache->fd), LOCKFILE_EXCLUSIVE_LOCK, 0, ~0, 0, &OverLapped))
    33713371        FatalDie("Failed to lock the cache file: Windows Error %d\n", GetLastError());
     3372#elif defined(__sun__)
     3373    {
     3374        struct flock fl;
     3375        fl.l_whence = 0;
     3376        fl.l_start = 0;
     3377        fl.l_len = 0;
     3378        fl.l_type = F_WRLCK;
     3379        if (fcntl(pCache->fd, F_SETLKW, &fl) != 0)
     3380            FatalDie("Failed to lock the cache file: %s\n", strerror(errno));
     3381    }
    33723382#else
    33733383    if (flock(pCache->fd, LOCK_EX) != 0)
     
    34263436    if (!UnlockFileEx((HANDLE)_get_osfhandle(pCache->fd), 0, ~0U, 0, &OverLapped))
    34273437        FatalDie("Failed to unlock the cache file: Windows Error %d\n", GetLastError());
     3438#elif defined(__sun__)
     3439    {
     3440        struct flock fl;
     3441        fl.l_whence = 0;
     3442        fl.l_start = 0;
     3443        fl.l_len = 0;
     3444        fl.l_type = F_UNLCK;
     3445        if (fcntl(pCache->fd, F_SETLKW, &fl) != 0)
     3446            FatalDie("Failed to lock the cache file: %s\n", strerror(errno));
     3447    }
    34283448#else
    34293449    if (flock(pCache->fd, LOCK_UN) != 0)
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