Fails to build in Ubuntu Jaunty: doesn't check return value of write()

Bug #300361 reported by James Westby on 2008-11-20
4
Affects Status Importance Assigned to Milestone
btnx
Undecided
Unassigned
btnx (Ubuntu)
High
Unassigned

Bug Description

Hi,

At

  http://launchpadlibrarian.net/19657063/buildlog_ubuntu-jaunty-i386.btnx_0.4.11-1_FAILEDTOBUILD.txt.gz

you can see that btnx failed to build in Ubuntu Jaunty. It has a stricter compiler
that warns about failing to check the return values of some functions. btnx
compiles with -Werror, so this fails the build.

write() returns the number of bytes written, or -1 on error, with errno being set.

While it would be possible to avoid the compile failure by not building with -Werror
it would be great to fix this, particularly as it is a bug waiting to happen.

Thanks,

James

Related branches

James Westby (james-w) on 2008-11-20
Changed in btnx:
importance: Undecided → High
status: New → Triaged
Stefan Lesicnik (stefanlsd) wrote :

Capture the return value of the write(). This fixes a FTBFS on Jaunty which uses -Werror.

The alternative is to do some proper checking if the buffer is successfully written. In the case of the information coming from a struct with set values, the likelyhood of not getting all the data is highly unlikely, hence just captured and ignored.

Stefan Lesicnik (stefanlsd) wrote :

Probably a better fix....

Changed in btnx:
status: New → Invalid
James Westby (james-w) on 2009-02-12
Changed in btnx:
status: Invalid → New
Changed in btnx:
status: New → Invalid
Onkar Shinde (onkarshinde) wrote :

For now I am accepting the first debdiff. It will be great if you can submit your 'better' fix to upstream.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package btnx - 0.4.11-1ubuntu1

---------------
btnx (0.4.11-1ubuntu1) jaunty; urgency=low

  * Capture the return value of the write(). Fixes FTBFS.
    (LP: #300361)

 -- Stefan Lesicnik <email address hidden> Mon, 09 Feb 2009 22:10:12 +0200

Changed in btnx:
status: Triaged → Fix Released
James Westby (james-w) wrote :

Please stop closing the btnx task, btnx uses launchpad for bug reports, so
it is already forwarded.

Thanks,

James

Changed in btnx:
status: Invalid → New
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers