[macruby-changes] [3289] MacRuby/trunk/MacRubyDebuggerConnector.m

source_changes at macosforge.org source_changes at macosforge.org
Sun Jan 17 21:20:52 PST 2010


Revision: 3289
          http://trac.macosforge.org/projects/ruby/changeset/3289
Author:   lsansonetti at apple.com
Date:     2010-01-17 21:20:49 -0800 (Sun, 17 Jan 2010)
Log Message:
-----------
relying on TMPDIR is a bad idea

Modified Paths:
--------------
    MacRuby/trunk/MacRubyDebuggerConnector.m

Modified: MacRuby/trunk/MacRubyDebuggerConnector.m
===================================================================
--- MacRuby/trunk/MacRubyDebuggerConnector.m	2010-01-17 23:32:17 UTC (rev 3288)
+++ MacRuby/trunk/MacRubyDebuggerConnector.m	2010-01-18 05:20:49 UTC (rev 3289)
@@ -55,10 +55,11 @@
     self = [super init];
     if (self != nil) {
 	// Generate the socket path.
-	const char *tmpdir = getenv("TMPDIR");
-	assert(tmpdir != NULL);
+	NSString *tmpdir = NSTemporaryDirectory();
+	assert(tmpdir != nil);
 	char path[PATH_MAX];
-	snprintf(path, sizeof path, "%s/macrubyd-XXXXXX", tmpdir);
+	snprintf(path, sizeof path, "%s/macrubyd-XXXXXX",
+		[tmpdir fileSystemRepresentation]);
 	assert(mktemp(path) != NULL);
 	_socketPath = [[NSFileManager defaultManager]
 	    stringWithFileSystemRepresentation:path length:strlen(path)];
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100117/03903b68/attachment.html>


More information about the macruby-changes mailing list