Remove now-empty legacy_globals.cpp/hpp.
+++ /dev/null
-// Copyright (C) 2020 Joel Rosdahl and other contributors
-//
-// See doc/AUTHORS.adoc for a complete list of contributors.
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by the Free
-// Software Foundation; either version 3 of the License, or (at your option)
-// any later version.
-//
-// This program is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-// more details.
-//
-// You should have received a copy of the GNU General Public License along with
-// this program; if not, write to the Free Software Foundation, Inc., 51
-// Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include "legacy_globals.hpp"
-
-// How long (in microseconds) to wait before breaking a stale lock.
-unsigned lock_staleness_limit = 2000000;
+++ /dev/null
-// Copyright (C) 2020 Joel Rosdahl and other contributors
-//
-// See doc/AUTHORS.adoc for a complete list of contributors.
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by the Free
-// Software Foundation; either version 3 of the License, or (at your option)
-// any later version.
-//
-// This program is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-// more details.
-//
-// You should have received a copy of the GNU General Public License along with
-// this program; if not, write to the Free Software Foundation, Inc., 51
-// Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-#pragma once
-
-#include "system.hpp"
-
-#include "ccache.hpp"
-#include "hash.hpp"
-
-#include <string>
-#include <unordered_map>
-
-// variable descriptions are in the .cpp file
-
-extern unsigned lock_staleness_limit;
#include <sys/types.h>
#include <unistd.h>
-extern unsigned lock_staleness_limit;
+// How long (in microseconds) to wait before breaking a stale lock.
+constexpr unsigned k_lock_staleness_limit = 2000000;
#define FLAG_NOZERO 1 // don't zero with the -z option
#define FLAG_ALWAYS 2 // always show, even if zero
"{}/{:x}/stats", config.cache_dir(), hash_from_int(getpid()) % 16);
}
- if (!lockfile_acquire(sfile.c_str(), lock_staleness_limit)) {
+ if (!lockfile_acquire(sfile.c_str(), k_lock_staleness_limit)) {
return;
}
free(fname);
continue;
}
- if (lockfile_acquire(fname, lock_staleness_limit)) {
+ if (lockfile_acquire(fname, k_lock_staleness_limit)) {
stats_read(fname, counters);
for (unsigned i = 0; stats_info[i].message; i++) {
if (!(stats_info[i].flags & FLAG_NOZERO)) {
{
struct counters* counters = counters_init(STATS_END);
char* statsfile = format("%s/stats", dir);
- if (lockfile_acquire(statsfile, lock_staleness_limit)) {
+ if (lockfile_acquire(statsfile, k_lock_staleness_limit)) {
stats_read(statsfile, counters);
counters->data[STATS_NUMFILES] = num_files;
counters->data[STATS_TOTALSIZE] = total_size / 1024;
{
struct counters* counters = counters_init(STATS_END);
char* statsfile = format("%s/stats", dir);
- if (lockfile_acquire(statsfile, lock_staleness_limit)) {
+ if (lockfile_acquire(statsfile, k_lock_staleness_limit)) {
stats_read(statsfile, counters);
counters->data[STATS_NUMCLEANUPS] += count;
stats_write(statsfile, counters);