*** empty log message ***
authorroot <root>
Wed, 1 Feb 2006 18:07:18 +0000 (18:07 +0000)
committerroot <root>
Wed, 1 Feb 2006 18:07:18 +0000 (18:07 +0000)
Changes
doc/rxvtc.1.pod
src/optinc.h
src/rsinc.h
src/rxvtc.C

diff --git a/Changes b/Changes
index 3bf05937018d9f1a5fbd918a7d149a2a40164097..706c337036ba762d98faa49dcfc6f1b613a618fb 100644 (file)
--- a/Changes
+++ b/Changes
@@ -20,6 +20,7 @@ TODO: rxvt -bg #comment
        - changed interpretation of [alpha] colour prefix.
         - +option now really sets the option to default, instead of using the
           resource value.
+        - use exit status 2 in urxvtc when urxvtd couldn't be contacted.
         - the linux yield hack is back, now using usleep, and enabled only on
           __linux__.
         - further round trip eliminations in the !XFT case by remembering
index 871efaf4e6e70a67c21bfef37a42b59040fdda6b..81d3b07063766fec910e6eddf213bfd1c4301c22 100644 (file)
@@ -21,6 +21,16 @@ B<@@RXVT_NAME@@c>, too. Please note that all options are currently
 interpreted in the context of the daemon process, which makes a difference
 for options that specify a file descriptor (such as B<-pty-fd>).
 
+=head1 EXIT STATUS
+
+If everything went well, @@RXVT_NAME@@c returns with an exit status of C<0>.
+If contacting the daemon fails, it exits with the exit status C<2>. In all other error
+cases it returns with status C<1>.
+
+This can be used to implement auto-starting behaviour, by checking for an
+exit status of C<2>, running C<@@RXVT_NAME@@d -f -q> and retrying the call
+to @@RXVT_NAME@@c.
+
 =head1 ENVIRONMENT
 
 All environment variables of the current process will be made available
index fee0e0845509901e094d1f24cab40949fae672fd..a3c404317c8f2dccbbbc979360d25102263a34a7 100644 (file)
@@ -1,3 +1,5 @@
+// all resource indices, used by rxvtlib.h and rxvtperl.xs
+
  def(console,               0)
  def(loginShell,            1)
  def(iconic,                2)
index 066c5c932ede43fc944c344d5766adb8e255cd9b..2ecec020a41f1bcf230759e6d32215192a065814 100644 (file)
@@ -1,4 +1,4 @@
-// all resource indices, used by rxvt.h anf rxvtperl.xs
+// all resource indices, used by rxvt.h and rxvtperl.xs
 
   def (display_name)
   def (term_name)
index 0dd2d1c7b304682db275f0762ba143e5773af78a..e43d04c0ea7e970ce79324dd92a010e9556cbccd 100644 (file)
 
 #include "rxvt.h"
 
+#define STATUS_SUCCESS           0
+#define STATUS_FAILURE           1
+#define STATUS_CONNECTION_FAILED 2
+
 struct client : rxvt_connection {
   client ();
 };
@@ -44,7 +48,7 @@ client::client ()
   if ((fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
     {
       perror ("unable to create communications socket");
-      exit (EXIT_FAILURE);
+      exit (STATUS_FAILURE);
     }
 
   char *sockname = rxvt_connection::unix_sockname ();
@@ -56,7 +60,7 @@ client::client ()
   if (connect (fd, (sockaddr *)&sa, sizeof (sa)))
     {
       perror ("unable to connect to the rxvt-unicode daemon");
-      exit (EXIT_FAILURE);
+      exit (STATUS_CONNECTION_FAILED);
     }
 }
 
@@ -82,7 +86,7 @@ main (int argc, const char *const *argv)
   if (!getcwd (cwd, sizeof (cwd)))
     {
       perror ("unable to determine current working directory");
-      exit (EXIT_FAILURE);
+      exit (STATUS_FAILURE);
     }
 
   c.send ("CWD"), c.send (cwd);
@@ -115,7 +119,7 @@ main (int argc, const char *const *argv)
         if (!ptytty::send_fd (c.fd, cint))
           {
             fprintf (stderr, "unable to send fd %d: ", cint); perror (0);
-            exit (EXIT_FAILURE);
+            exit (STATUS_FAILURE);
           }
       }
     else if (!strcmp (tok, "END"))
@@ -123,7 +127,7 @@ main (int argc, const char *const *argv)
         int success;
 
         if (c.recv (success))
-          exit (success ? EXIT_SUCCESS : EXIT_FAILURE);
+          exit (success ? STATUS_SUCCESS : STATUS_FAILURE);
       }
     else
       {
@@ -131,6 +135,6 @@ main (int argc, const char *const *argv)
         break;
       }
 
-  return EXIT_FAILURE;
+  return STATUS_FAILURE;
 }