diff options
author | Jim Jagielski <jim@apache.org> | 2013-10-08 14:17:33 +0000 |
---|---|---|
committer | Jim Jagielski <jim@apache.org> | 2013-10-08 14:17:33 +0000 |
commit | 869216b403fef0895a85827cfd9fe618b3c1a9e2 (patch) | |
tree | 4c90e6c1fdc6893aaa4c37c917d721bde86e7152 /server | |
parent | f12493dcba8c0a4c2e831f36c9955cc62c5ab2a2 (diff) | |
download | httpd-869216b403fef0895a85827cfd9fe618b3c1a9e2.tar.gz |
Merge r1527008 from trunk:
Fix the null device name on Windows so that stderr can be sent
to the bit bucket. (This logic is always hit when using an error
log provider.)
Submitted by: trawick
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1530279 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r-- | server/log.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/server/log.c b/server/log.c index 7bbd708b61..bcfdcdb6eb 100644 --- a/server/log.c +++ b/server/log.c @@ -509,9 +509,16 @@ int ap_open_logs(apr_pool_t *pconf, apr_pool_t *p /* plog */, * XXX: This is BS - /dev/null is non-portable * errno-as-apr_status_t is also non-portable */ - if (replace_stderr && freopen("/dev/null", "w", stderr) == NULL) { + +#ifdef WIN32 +#define NULL_DEVICE "nul" +#else +#define NULL_DEVICE "/dev/null" +#endif + + if (replace_stderr && freopen(NULL_DEVICE, "w", stderr) == NULL) { ap_log_error(APLOG_MARK, APLOG_CRIT, errno, s_main, APLOGNO(00093) - "unable to replace stderr with /dev/null"); + "unable to replace stderr with %s", NULL_DEVICE); } for (virt = s_main->next; virt; virt = virt->next) { |