if (it->is_loaded())
{
s << ", loaded";
+ if (it->is_locked(clients))
+ s << ", locked";
if (it->use_count() == 0)
s << ", unused for " << duration_cast<milliseconds>(it->unused_for()).count() << "ms";
else
/*
* Copyright (c) [2012-2015] Novell, Inc.
- * Copyright (c) [2018-2023] SUSE LLC
+ * Copyright (c) [2018-2024] SUSE LLC
*
* All Rights Reserved.
*
#include <snapper/SnapperDefines.h>
#include "MetaSnapper.h"
+#include "Client.h"
MetaSnappers meta_snappers;
}
+bool
+MetaSnapper::is_locked(const Clients& clients) const
+{
+ for (const Client& client : clients)
+ if (client.has_lock(configName()))
+ return true;
+
+ return false;
+}
+
+
MetaSnappers::MetaSnappers()
{
}
/*
* Copyright (c) [2012-2015] Novell, Inc.
- * Copyright (c) [2018-2023] SUSE LLC
+ * Copyright (c) [2018-2024] SUSE LLC
*
* All Rights Reserved.
*
using namespace snapper;
+class Clients;
+
+
struct UnknownConfig : public Exception
{
explicit UnknownConfig() : Exception("unknown config") {}
bool is_loaded() const { return snapper; }
void unload();
+ bool is_locked(const Clients& clients) const;
+
private:
void set_permissions();