Fails to build in Ubuntu Jaunty: doesn't check return value of write()
Bug #300361 reported by
James Westby
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
btnx |
New
|
Undecided
|
Unassigned | ||
btnx (Ubuntu) |
Fix Released
|
High
|
Unassigned |
Bug Description
Hi,
At
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
Changed in btnx: | |
importance: | Undecided → High |
status: | New → Triaged |
Changed in btnx: | |
status: | New → Invalid |
Changed in btnx: | |
status: | Invalid → New |
Changed in btnx: | |
status: | New → Invalid |
To post a comment you must log in.
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.