Postfix3.3.1
debug_process.c
[詳解]
1 /*++
2 /* NAME
3 /* debug_process 3
4 /* SUMMARY
5 /* run an external debugger
6 /* SYNOPSIS
7 /* #include <debug_process.h>
8 /*
9 /* char *debug_process()
10 /* DESCRIPTION
11 /* debug_process() runs a debugger, as specified in the
12 /* \fIdebugger_command\fR configuration variable.
13 /*
14 /* Examples of non-interactive debuggers are call tracing tools
15 /* such as: trace, strace or truss.
16 /*
17 /* Examples of interactive debuggers are xxgdb, xxdbx, and so on.
18 /* In order to use an X-based debugger, the process must have a
19 /* properly set up XAUTHORITY environment variable.
20 /* LICENSE
21 /* .ad
22 /* .fi
23 /* The Secure Mailer license must be distributed with this software.
24 /* AUTHOR(S)
25 /* Wietse Venema
26 /* IBM T.J. Watson Research
27 /* P.O. Box 704
28 /* Yorktown Heights, NY 10598, USA
29 /*--*/
30 
31 /* System library. */
32 
33 #include <sys_defs.h>
34 #include <string.h>
35 #include <stdlib.h>
36 #include <unistd.h>
37 
38 /* Utility library. */
39 
40 #include <msg.h>
41 
42 /* Global library. */
43 
44 #include "mail_params.h"
45 #include "mail_conf.h"
46 #include "debug_process.h"
47 
48 /* debug_process - run a debugger on this process */
49 
50 void debug_process(void)
51 {
52  const char *command;
53 
54  /*
55  * Expand $debugger_command then run it.
56  */
58  if (command == 0 || *command == 0)
59  msg_fatal("no %s variable set up", VAR_DEBUG_COMMAND);
60  msg_info("running: %s", command);
61  system(command);
62 }
void debug_process(void)
Definition: debug_process.c:50
NORETURN msg_fatal(const char *fmt,...)
Definition: msg.c:249
const char * mail_conf_lookup_eval(const char *name)
Definition: mail_conf.c:262
VAR_DEBUG_COMMAND
Definition: install_table.h:1
void msg_info(const char *fmt,...)
Definition: msg.c:199