update_engine: Add override when possible.
Google Style Guide requires to include the "override" keyword
when overriding a method on a derived class, so the compiler will
catch errors if the method is not overriding a member of the base
class.
This patch introduces the "override" keyword when possible.
BUG=None
TEST=FEATURES=test emerge-link update_engine
Change-Id: Ie83d115c5730f3b35b3d95859a54bc1a48e0be7b
Reviewed-on: https://chromium-review.googlesource.com/228928
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/file_descriptor.h b/file_descriptor.h
index 3b1f1b2..d86d4ca 100644
--- a/file_descriptor.h
+++ b/file_descriptor.h
@@ -82,19 +82,18 @@
class EintrSafeFileDescriptor : public FileDescriptor {
public:
EintrSafeFileDescriptor() : fd_(-1) {}
- virtual ~EintrSafeFileDescriptor() {}
// Interface methods.
- virtual bool Open(const char* path, int flags, mode_t mode);
- virtual bool Open(const char* path, int flags);
- virtual ssize_t Read(void* buf, size_t count);
- virtual ssize_t Write(const void* buf, size_t count);
- virtual bool Close();
- virtual void Reset();
- virtual bool IsSettingErrno() {
+ bool Open(const char* path, int flags, mode_t mode) override;
+ bool Open(const char* path, int flags) override;
+ ssize_t Read(void* buf, size_t count) override;
+ ssize_t Write(const void* buf, size_t count) override;
+ bool Close() override;
+ void Reset() override;
+ bool IsSettingErrno() override {
return true;
}
- virtual bool IsOpen() {
+ bool IsOpen() override {
return (fd_ >= 0);
}