diff --git a/src/lib/nfs/FileReader.cxx b/src/lib/nfs/FileReader.cxx index f248778f5..5a4aa3b91 100644 --- a/src/lib/nfs/FileReader.cxx +++ b/src/lib/nfs/FileReader.cxx @@ -33,7 +33,7 @@ #include NfsFileReader::NfsFileReader() - :DeferredMonitor(nfs_get_event_loop()), state(State::INITIAL) + :DeferredMonitor(nfs_get_event_loop()) { } diff --git a/src/lib/nfs/FileReader.hxx b/src/lib/nfs/FileReader.hxx index 4c3b80f7f..a7c50b506 100644 --- a/src/lib/nfs/FileReader.hxx +++ b/src/lib/nfs/FileReader.hxx @@ -54,7 +54,7 @@ class NfsFileReader : NfsLease, NfsCallback, DeferredMonitor { IDLE, }; - State state; + State state = State::INITIAL; std::string server, export_name; const char *path; diff --git a/src/storage/plugins/NfsStorage.cxx b/src/storage/plugins/NfsStorage.cxx index 55bdf8fc3..eec8c7682 100644 --- a/src/storage/plugins/NfsStorage.cxx +++ b/src/storage/plugins/NfsStorage.cxx @@ -65,7 +65,7 @@ class NfsStorage final Mutex mutex; Cond cond; - State state; + State state = State::INITIAL; std::exception_ptr last_exception; public: @@ -75,8 +75,7 @@ public: base(_base), server(std::move(_server)), export_name(std::move(_export_name)), - reconnect_timer(_loop, BIND_THIS_METHOD(OnReconnectTimer)), - state(State::INITIAL) { + reconnect_timer(_loop, BIND_THIS_METHOD(OnReconnectTimer)) { nfs_init(_loop); }