Together with svptest, it excersises the headless mode - so you can
watch vcl render to some framebuffer device. Still useful code.
OK. So shouldn't we then fix the code to work correctly, not just get rid of compiler warnings?
I.e., in
+ nBytes = write( nSocket, rCommand.getStr(), rCommand.getLength() );
+ if( nBytes < rCommand.getLength() )
+ perror( "SvpElementContainer: write() failed" );
just calling perror() isn't right in case less bytes were written than requested; that is a
perfectly valid situation (even if perhaps rare, for "sane" lengths and "normal" networks) . It is
only if write() returns -1 that it has failed, a partial write is not an error.
The code should either 1) not bother to handle the partial write case, handle it like a write()
failure, and then exit(1) in addition to the perror(), or 2) exit on write error, but handle
partial writes by looping until everything has been written. Just continuing as if everything
requested was written when the return value indicates it wasn't is wrong.
--tml
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.