diff --git a/judge/runguard.cc b/judge/runguard.cc index 2a7dc61a8e..1eff89f308 100644 --- a/judge/runguard.cc +++ b/judge/runguard.cc @@ -308,12 +308,15 @@ void write_meta(const char *key, const char *format, ...) va_start(ap,format); if ( fprintf(metafile,"%s: ",key)<=0 ) { + outputmeta = 0; error(0,"cannot write to file `%s'",metafilename); } if ( vfprintf(metafile,format,ap)<0 ) { + outputmeta = 0; error(0,"cannot write to file `%s'(vfprintf)",metafilename); } if ( fprintf(metafile,"\n")<=0 ) { + outputmeta = 0; error(0,"cannot write to file `%s'",metafilename); }