repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 51b6557c4f72b163631bb125c76037cede63b308: path_to: revision_to:
commit 51b6557c4f72b163631bb125c76037cede63b308 Author: Emanuele GiaquintaDate: Mon Oct 6 11:14:49 2014 +0000 Add -k option to urxvtc for killing the daemon process. diff --git a/doc/rxvtc.1.pod b/doc/rxvtc.1.pod
--- a/doc/rxvtc.1.pod +++ b/doc/rxvtc.1.pod @@ -16,6 +16,9 @@ contacting the daemon. =head1 OPTIONS +If the first option is B<-k>, B<@@RXVT_NAME@@c> tries to kill the +daemon process and returns. + All options that are valid for B<@@RXVT_NAME@@> are valid for B<@@RXVT_NAME@@c>, too. Please note that options are interpreted in the context of the daemon process. However, as current working directory, diff --git a/src/rxvtc.C b/src/rxvtc.C
--- a/src/rxvtc.C
+++ b/src/rxvtc.C
@@ -95,6 +95,12 @@ main (int argc, const char *const *argv)
sigprocmask (SIG_BLOCK, &ss, 0);
}
+ if (argc >= 2 && !strcmp (argv[1], "-k"))
+ {
+ c.send ("QUIT");
+ return 0;
+ }
+
c.send ("NEW");
for (char **var = environ; *var; var++)
diff --git a/src/rxvtd.C b/src/rxvtd.C
--- a/src/rxvtd.C
+++ b/src/rxvtd.C
@@ -215,6 +215,8 @@ void server::read_cb (ev::io &w, int revents)
send ("END"); send (success ? 1 : 0);
}
}
+ else if (!strcmp (tok, "QUIT"))
+ _exit (0);
else
return err ("protocol error: request '%s' unsupported.\n", (char *)tok);
}
-----END OF PAGE-----