Merge branch 'notroj-xmlwf-doc-exitcode' (#403)

This commit is contained in:
Sebastian Pipping 2020-05-13 14:42:18 +02:00
commit 867bb34373
3 changed files with 34 additions and 9 deletions

View file

@ -9,6 +9,9 @@ Release x.x.x xxx xxxxxxxxx xx xxxx
Other changes:
#396 Windows: Drop support for Visual Studio <=8.0/2005
#403 xmlwf: Document exit codes in xmlwf manpage and
exit with code 3 (rather than code 1) for output errors
when used with "-d DIRECTORY"
#383 #392 Autotools: Use -Werror while configure tests the compiler
for supported compile flags to avoid false positives
#383 #393 Autotools: Improve handling of user (C|CPP|CXX|LD)FLAGS,
@ -33,6 +36,7 @@ Release x.x.x xxx xxxxxxxxx xx xxxx
asavah
Ben Wagner
Jeffrey Walton
Joe Orton
Ma Lin
Maciej Sroczyński
Mohammed Khajapasha

View file

@ -383,19 +383,40 @@ supports both.
<command>&dhpackage;</command> prints a single line describing
the problem to standard output. If a file is well formed,
<command>&dhpackage;</command> outputs nothing.
Note that the result code is <emphasis>not</emphasis> set.
</para>
</refsect1>
<refsect1>
<title>EXIT STATUS</title>
<para>For option <option>-v</option> or <option>-h</option>, <command>&dhpackage;</command> always exits with status code 0. For other cases, the following exit status codes are returned:
<variablelist>
<varlistentry>
<term><option>0</option></term>
<listitem><para>The input files are well-formed.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>1</option></term>
<listitem><para>An internal error occurred.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>2</option></term>
<listitem><para>An input file was not well-formed or could not be parsed.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>3</option></term>
<listitem><para>If using the <option>-d</option> option, an error occurred opening an output file.</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1>
<title>BUGS</title>
<para>
<command>&dhpackage;</command> returns a 0 - noerr result,
even if the file is not well-formed. There is no good way for
a program to use <command>&dhpackage;</command> to quickly
check a file -- it must parse <command>&dhpackage;</command>'s
standard output.
</para>
<para>
The errors should go to standard error, not standard output.
</para>

View file

@ -1057,7 +1057,7 @@ tmain(int argc, XML_Char **argv) {
userData.fp = tfopen(outName, T("wb"));
if (! userData.fp) {
tperror(outName);
exit(1);
exit(3);
}
setvbuf(userData.fp, NULL, _IOFBF, 16384);
#ifdef XML_UNICODE