- 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
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
#include "rxvt.h"
+#define STATUS_SUCCESS 0
+#define STATUS_FAILURE 1
+#define STATUS_CONNECTION_FAILED 2
+
struct client : rxvt_connection {
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 ();
if (connect (fd, (sockaddr *)&sa, sizeof (sa)))
{
perror ("unable to connect to the rxvt-unicode daemon");
- exit (EXIT_FAILURE);
+ exit (STATUS_CONNECTION_FAILED);
}
}
if (!getcwd (cwd, sizeof (cwd)))
{
perror ("unable to determine current working directory");
- exit (EXIT_FAILURE);
+ exit (STATUS_FAILURE);
}
c.send ("CWD"), c.send (cwd);
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"))
int success;
if (c.recv (success))
- exit (success ? EXIT_SUCCESS : EXIT_FAILURE);
+ exit (success ? STATUS_SUCCESS : STATUS_FAILURE);
}
else
{
break;
}
- return EXIT_FAILURE;
+ return STATUS_FAILURE;
}