mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +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
982982f631
commit
96a43795ee
2 changed files with 14 additions and 8 deletions
|
@ -1186,13 +1186,15 @@ typedef struct {
|
||||||
{
|
{
|
||||||
static int unique_index = 0;
|
static int unique_index = 0;
|
||||||
NSString *path;
|
NSString *path;
|
||||||
NSNumber *p = [NSNumber numberWithInt: 0700];
|
|
||||||
NSDictionary *attr;
|
NSDictionary *attr;
|
||||||
|
|
||||||
attr = [NSDictionary dictionaryWithObject: p
|
if (nil == (path = NSTemporaryDirectory()))
|
||||||
forKey: NSFilePosixPermissions];
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
path = NSTemporaryDirectory();
|
attr = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt: 0700]
|
||||||
|
forKey: NSFilePosixPermissions];
|
||||||
|
|
||||||
path = [path stringByAppendingPathComponent: @"NSMessagePort"];
|
path = [path stringByAppendingPathComponent: @"NSMessagePort"];
|
||||||
[[NSFileManager defaultManager] createDirectoryAtPath: path
|
[[NSFileManager defaultManager] createDirectoryAtPath: path
|
||||||
|
|
|
@ -269,12 +269,16 @@ static void clean_up_names(void)
|
||||||
[serverLock lock];
|
[serverLock lock];
|
||||||
if (!base_path)
|
if (!base_path)
|
||||||
{
|
{
|
||||||
NSNumber *p = [NSNumber numberWithInt: 0700];
|
|
||||||
NSDictionary *attr;
|
NSDictionary *attr;
|
||||||
|
|
||||||
path = NSTemporaryDirectory();
|
if (nil == (path = NSTemporaryDirectory()))
|
||||||
attr = [NSDictionary dictionaryWithObject: p
|
{
|
||||||
forKey: NSFilePosixPermissions];
|
[serverLock unlock];
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
attr = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt: 0700]
|
||||||
|
forKey: NSFilePosixPermissions];
|
||||||
|
|
||||||
path = [path stringByAppendingPathComponent: @"NSMessagePort"];
|
path = [path stringByAppendingPathComponent: @"NSMessagePort"];
|
||||||
[[NSFileManager defaultManager] createDirectoryAtPath: path
|
[[NSFileManager defaultManager] createDirectoryAtPath: path
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue