mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
check for failure to create temporary directory
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35394 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5904a38efd
commit
fd85d91b8a
2 changed files with 14 additions and 8 deletions
|
@ -1186,13 +1186,15 @@ typedef struct {
|
|||
{
|
||||
static int unique_index = 0;
|
||||
NSString *path;
|
||||
NSNumber *p = [NSNumber numberWithInt: 0700];
|
||||
NSDictionary *attr;
|
||||
|
||||
attr = [NSDictionary dictionaryWithObject: p
|
||||
forKey: NSFilePosixPermissions];
|
||||
if (nil == (path = NSTemporaryDirectory()))
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
path = NSTemporaryDirectory();
|
||||
attr = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt: 0700]
|
||||
forKey: NSFilePosixPermissions];
|
||||
|
||||
path = [path stringByAppendingPathComponent: @"NSMessagePort"];
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath: path
|
||||
|
|
|
@ -269,12 +269,16 @@ static void clean_up_names(void)
|
|||
[serverLock lock];
|
||||
if (!base_path)
|
||||
{
|
||||
NSNumber *p = [NSNumber numberWithInt: 0700];
|
||||
NSDictionary *attr;
|
||||
|
||||
path = NSTemporaryDirectory();
|
||||
attr = [NSDictionary dictionaryWithObject: p
|
||||
forKey: NSFilePosixPermissions];
|
||||
if (nil == (path = NSTemporaryDirectory()))
|
||||
{
|
||||
[serverLock unlock];
|
||||
return nil;
|
||||
}
|
||||
|
||||
attr = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt: 0700]
|
||||
forKey: NSFilePosixPermissions];
|
||||
|
||||
path = [path stringByAppendingPathComponent: @"NSMessagePort"];
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath: path
|
||||
|
|
Loading…
Reference in a new issue