summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2002-11-18 17:07:10 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2002-11-18 17:07:10 +0000
commitbb957397c13ca9f7df29ede24d5eac4d3e3800a1 (patch)
tree3f2824d2ab291e0a6ce379e6e7b31014ba08ed73
parent5e303a63481165da46a78de98f4aadbd892b4d9e (diff)
downloadmailutils-bb957397c13ca9f7df29ede24d5eac4d3e3800a1.tar.gz
mailutils-bb957397c13ca9f7df29ede24d5eac4d3e3800a1.tar.bz2
Test if environment variable MTA_APPEND is set.
-rw-r--r--examples/mta.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/mta.c b/examples/mta.c
index f80b7c439..bc88ac6fc 100644
--- a/examples/mta.c
+++ b/examples/mta.c
@@ -40,6 +40,8 @@
is "localhost".
MTA_DIAG Sets the name of the output diagnostic file. By default,
the diagnostics goes to stderr.
+ MTA_APPEND When set to any non-empty value, directs mta to append
+ to the diagnostics file, not to overwrite it.
*/
@@ -130,7 +132,8 @@ main (int argc, char **argv)
char *name = getenv ("MTA_DIAG");
if (name)
{
- diag = fopen (name, "w");
+ char *mode = getenv ("MTA_APPEND") ? "a" : "w";
+ diag = fopen (name, mode);
if (!diag)
{
mu_error ("%s: can't open diagnostic output: %s",

Return to:

Send suggestions and report system problems to the System administrator.