D6197: Add kauth helper to file ioslave
Chinmoy Ranjan Pradhan
noreply at phabricator.kde.org
Tue Aug 1 17:21:37 UTC 2017
chinmoyr added inline comments.
INLINE COMMENTS
> dfaure wrote in filehelper.cpp:86
> opendir can return 0, in which case the next line will probably crash.
>
> Overall, this whole method seriously lacks error handling in my opinion. Just checking for errno at the end isn't enough, e.g. in cases like this where multiple calls are being made.
>
> And even otherwise, I'm unsure if ignoring the return value of chmod/chown/unlink/mkdir and *just* checking errno is enough or not. Does anyone else know?
In case of OPEN and OPENDIR, I can see why we need error checking, opendir() can return null and there are some issues (I read on internet, can't recall the source) if close() fails. But in case of single function calls like chmod() I can't see how return value matters. Say if unlink fails for whatever reasons, we can return the error code and the checking for exact error code can be done by ioslave. Is there something I am overlooking?
REVISION DETAIL
https://phabricator.kde.org/D6197
To: chinmoyr, elvisangelaccio, #frameworks, dfaure
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170801/b8a0f454/attachment.html>
More information about the Kde-frameworks-devel
mailing list