From b0296139a8ca3c15cd601ca1449e6547c8a352a0 Mon Sep 17 00:00:00 2001 From: seyko Date: Wed, 13 Apr 2016 05:17:13 +0300 Subject: [PATCH] fix for the -dM patch assign fopen("/dev/null","w") to the s->ppfp insteed of NULL --- tcc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tcc.c b/tcc.c index b49a2031..d3739808 100644 --- a/tcc.c +++ b/tcc.c @@ -302,8 +302,13 @@ int main(int argc, char **argv) tcc_error("could not write '%s'", s->outfile); } s->dffp = s->ppfp; - if (s->dflag == 'M') - s->ppfp = NULL; + if (s->dflag == 'M') { +#ifndef TCC_TARGET_PE + s->ppfp = fopen("/dev/null", "w"); +#else + s->ppfp = fopen("nul", "w"); +#endif + } } tcc_set_output_type(s, s->output_type);