diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-12-28 22:03:29 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-12-28 22:03:29 +0000 |
commit | 7b7456c31276011f012ae7d9f02437ae31071c8c (patch) | |
tree | 80721df166d1d6c5e6798908f7f30e9c5134ec3b /bin/bbackupd | |
parent | 1c1872a295a8f624feda363b9edb366da97798c6 (diff) |
Improve debugging of named pipe operations and bbackupctl pipe interaction.
Diffstat (limited to 'bin/bbackupd')
-rw-r--r-- | bin/bbackupd/BackupDaemon.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/bbackupd/BackupDaemon.h b/bin/bbackupd/BackupDaemon.h index a6cb8d46..ba46dec2 100644 --- a/bin/bbackupd/BackupDaemon.h +++ b/bin/bbackupd/BackupDaemon.h @@ -109,6 +109,25 @@ public: }; int GetState() {return mState;} + static std::string GetStateName(int state) + { + std::string stateName; + + #define STATE(x) case BackupDaemon::State_ ## x: stateName = #x; break; + switch (state) + { + STATE(Initialising); + STATE(Idle); + STATE(Connected); + STATE(Error); + STATE(StorageLimitExceeded); + default: + stateName = "unknown"; + } + #undef STATE + + return stateName; + } // Allow other classes to call this too void NotifySysadmin(SysadminNotifier::EventCode Event); |