[darwinbuild-changes] [484] branches/PR-6688645/darwinup/File.cpp

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 18 14:45:36 PDT 2009


Revision: 484
          http://trac.macosforge.org/projects/darwinbuild/changeset/484
Author:   wsiegrist at apple.com
Date:     2009-03-18 14:45:36 -0700 (Wed, 18 Mar 2009)
Log Message:
-----------
Go back to just calling path() once during File remove() APIs

Modified Paths:
--------------
    branches/PR-6688645/darwinup/File.cpp

Modified: branches/PR-6688645/darwinup/File.cpp
===================================================================
--- branches/PR-6688645/darwinup/File.cpp	2009-03-18 21:34:32 UTC (rev 483)
+++ branches/PR-6688645/darwinup/File.cpp	2009-03-18 21:45:36 UTC (rev 484)
@@ -226,8 +226,9 @@
 
 int Regular::remove() {
 	int res = 0;
-	res = unlink(this->path());
-	IF_DEBUG("[remove] unlink %s\n", this->path());
+	const char* path = this->path();
+	res = unlink(path);
+	IF_DEBUG("[remove] unlink %s\n", path);
 	if (res == -1 && errno == ENOENT) {
 		// We can safely ignore this because we were going to
 		// remove the file anyway
@@ -250,8 +251,9 @@
 
 int Symlink::remove() {
 	int res = 0;
-	res = unlink(this->path());
-	IF_DEBUG("[remove] unlink %s", this->path());
+	const char* path = this->path();
+	res = unlink(path);
+	IF_DEBUG("[remove] unlink %s", path);
 	if (res == -1 && errno == ENOENT) {
 		// We can safely ignore this because we were going to
 		// remove the file anyway
@@ -304,14 +306,15 @@
 
 int Directory::remove() {
 	int res = 0;
-	res = rmdir(this->path());
-	IF_DEBUG("[remove] rmdir %s\n", this->path());
+	const char* path = this->path();
+	res = rmdir(path);
+	IF_DEBUG("[remove] rmdir %s\n", path);
 	if (res == -1 && errno == ENOENT) {
 		// We can safely ignore this because we were going to
 		// remove the directory anyway
 		res = 0;
 	} else if (res == -1 && errno == ENOTEMPTY) {
-	        res = remove_directory(this->path());
+	        res = remove_directory(path);
 	} else if (res == -1) {
 		fprintf(stderr, "%s:%d: %s (%d)\n", __FILE__, __LINE__, strerror(errno), errno);
 	}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20090318/2366f012/attachment-0001.html>


More information about the darwinbuild-changes mailing list