Simplify write condition
AbandonedPublic

Authored by shubham on Mar 29 2019, 6:32 AM.

Details

Summary

As opposite to it's counterpart(read()), write() function does return -1 on failure

Diff Detail

Repository
R16 KPMCore
Branch
buffer
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10237
Build 10255: arc lint + arc unit
shubham requested review of this revision.Mar 29 2019, 6:32 AM
shubham created this revision.
shubham edited the summary of this revision. (Show Details)Mar 29 2019, 6:33 AM
shubham added a project: KDE Partition Manager.
shubham added a subscriber: KDE Partition Manager.
pino requested changes to this revision.Mar 29 2019, 6:39 AM
pino added a subscriber: pino.
pino added inline comments.
src/util/externalcommandhelper.cpp
93

unrelated to the patch

148

this change is not correct: now it will fail only when write() writes no data, while before it failed when write() wrote less than the requested data
this is also not correct according to your explanation: if you want to check whether a function that returns -1 on failure actually failed, then !value is definitely not correct (you need value < 0 or value == -1)

This revision now requires changes to proceed.Mar 29 2019, 6:39 AM
shubham abandoned this revision.Mar 29 2019, 6:52 AM