Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9a933bc
)
Allow panic_action to be configured through environment variable RSYNC_PANIC_ACTION.
author
Martin Pool
<mbp@samba.org>
Mon, 8 Apr 2002 07:34:17 +0000
(07:34 +0000)
committer
Martin Pool
<mbp@samba.org>
Mon, 8 Apr 2002 07:34:17 +0000
(07:34 +0000)
main.c
patch
|
blob
|
blame
|
history
diff --git
a/main.c
b/main.c
index
b946e75
..
254d9d5
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-816,13
+816,24
@@
static RETSIGTYPE sigchld_handler(int UNUSED(val)) {
* Solaris?) Can we be more portable?
**/
#ifdef MAINTAINER_MODE
* Solaris?) Can we be more portable?
**/
#ifdef MAINTAINER_MODE
+const char *get_panic_action(void)
+{
+ const char *cmd_fmt = getenv("RSYNC_PANIC_ACTION");
+
+ if (cmd_fmt)
+ return cmd_fmt;
+ else
+ return "xterm -display :0 -T Panic -n Panic "
+ "-e gdb /proc/%d/exe %d";
+}
+
+
static RETSIGTYPE rsync_panic_handler(int UNUSED(whatsig))
{
char cmd_buf[300];
int ret;
static RETSIGTYPE rsync_panic_handler(int UNUSED(whatsig))
{
char cmd_buf[300];
int ret;
- sprintf(cmd_buf,
- "xterm -display :0 -T Panic -n Panic "
- "-e gdb /proc/%d/exe %d",
+
+ sprintf(cmd_buf, get_panic_action(),
getpid(), getpid());
/* Unless we failed to execute gdb, we allow the process to
getpid(), getpid());
/* Unless we failed to execute gdb, we allow the process to