streamline the protocol a bit
authorroot <root>
Sun, 18 Nov 2007 00:21:34 +0000 (00:21 +0000)
committerroot <root>
Sun, 18 Nov 2007 00:21:34 +0000 (00:21 +0000)
src/rxvtc.C

index 92095707c50b97f66168be6110db9da3e139135b..4660a750d2096275d2f4b0b7bfbcc30d5eab299b 100644 (file)
@@ -77,7 +77,17 @@ extern char **environ;
 int
 main (int argc, const char *const *argv)
 {
+  // instead of getcwd we could opendir (".") and pass the fd for fchdir *g*
+  char cwd[PATH_MAX];
+
+  if (!getcwd (cwd, sizeof (cwd)))
+    {
+      perror ("unable to determine current working directory");
+      exit (STATUS_FAILURE);
+    }
+
   client c;
+
   {
     sigset_t ss;
 
@@ -88,16 +98,6 @@ main (int argc, const char *const *argv)
   }
 
   c.send ("NEW");
-
-  // instead of getcwd we could opendir (".") and pass the fd for fchdir *g*
-  char cwd[PATH_MAX];
-
-  if (!getcwd (cwd, sizeof (cwd)))
-    {
-      perror ("unable to determine current working directory");
-      exit (STATUS_FAILURE);
-    }
-
   c.send ("CWD"), c.send (cwd);
 
   for (char **var = environ; *var; var++)