Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH 3/3] credential-cache--daemon: change to the socket dir on startup

From: Jeff King <hidden>
Date: 2016-06-15 23:08:23

Possibly related (same subject, not in this thread)

On Tue, Feb 23, 2016 at 01:09:44PM -0800, Junio C Hamano wrote:
quoted hunk ↗ jump to hunk
I tentatively squashed this, which I think reads better.
diff --git a/credential-cache--daemon.c b/credential-cache--daemon.c
index 9a3a7a3..6b00ee0 100644
--- a/credential-cache--daemon.c
+++ b/credential-cache--daemon.c
@@ -237,12 +237,13 @@ static void init_socket_directory(const char *path)
 			die_errno("unable to mkdir '%s'", dir);
 	}
 
-	/*
-	 * We don't actually care what our cwd is; we chdir here just to
-	 * be a friendly daemon and avoid tying up our original cwd.
-	 * If this fails, it's OK to just continue without that benefit.
-	 */
-	chdir(dir);
+	if (chdir(dir))
+		/*
+		 * We don't actually care what our cwd is; we chdir here just to
+		 * be a friendly daemon and avoid tying up our original cwd.
+		 * If this fails, it's OK to just continue without that benefit.
+		 */
+		;
 
 	free(path_copy);
 }
That looks great, thanks.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help