~ubuntu-branches/ubuntu/trusty/gnustep-base/trusty

« back to all changes in this revision

Viewing changes to Source/NSDistributedLock.m

Tags: upstream-1.20.0
ImportĀ upstreamĀ versionĀ 1.20.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
   Boston, MA 02111 USA.
23
23
 
24
24
   <title>NSDistributedLock class reference</title>
25
 
   $Date: 2008-09-19 09:44:28 +0100 (Fri, 19 Sep 2008) $ $Revision: 26860 $
 
25
   $Date: 2010-02-25 11:49:31 -0700 (Thu, 25 Feb 2010) $ $Revision: 29753 $
26
26
   */
27
27
 
28
 
#include "config.h"
 
28
#import "common.h"
29
29
#include <string.h>
30
 
#include "Foundation/NSDistributedLock.h"
31
 
#include "Foundation/NSFileManager.h"
32
 
#include "Foundation/NSException.h"
33
 
#include "Foundation/NSValue.h"
34
 
#include "Foundation/NSDebug.h"
35
 
#include "GSPrivate.h"
 
30
#define EXPOSE_NSDistributedLock_IVARS  1
 
31
#import "Foundation/NSDistributedLock.h"
 
32
#import "Foundation/NSFileManager.h"
 
33
#import "Foundation/NSException.h"
 
34
#import "Foundation/NSValue.h"
 
35
#import "GSPrivate.h"
36
36
 
37
37
#include <fcntl.h>
38
38
 
132
132
  if ([mgr fileExistsAtPath: lockDir isDirectory: &isDirectory] == NO)
133
133
    {
134
134
      NSLog(@"part of the path to the lock file '%@' is missing\n", aPath);
135
 
      RELEASE(self);
 
135
      DESTROY(self);
136
136
      return nil;
137
137
    }
138
138
  if (isDirectory == NO)
139
139
    {
140
140
      NSLog(@"part of the path to the lock file '%@' is not a directory\n",
141
141
        _lockPath);
142
 
      RELEASE(self);
 
142
      DESTROY(self);
143
143
      return nil;
144
144
    }
145
145
  if ([mgr isWritableFileAtPath: lockDir] == NO)
146
146
    {
147
147
      NSLog(@"parent directory of lock file '%@' is not writable\n", _lockPath);
148
 
      RELEASE(self);
 
148
      DESTROY(self);
149
149
      return nil;
150
150
    }
151
151
  if ([mgr isExecutableFileAtPath: lockDir] == NO)
152
152
    {
153
153
      NSLog(@"parent directory of lock file '%@' is not accessible\n",
154
154
                _lockPath);
155
 
      RELEASE(self);
 
155
      DESTROY(self);
156
156
      return nil;
157
157
    }
158
158
  return self;