From 8a2fb75462318a748601578c99318907f83dfdc3 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Mon, 16 Nov 2020 18:10:45 -0500 Subject: [PATCH] fd: move relative path string to library Use a single static variable located in the library, instead of having a separate one for each compilation unit. Signed-off-by: Zygo Blaxell --- include/crucible/fd.h | 1 - lib/fd.cc | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/crucible/fd.h b/include/crucible/fd.h index 6890417..d9062b2 100644 --- a/include/crucible/fd.h +++ b/include/crucible/fd.h @@ -57,7 +57,6 @@ namespace crucible { typedef ResourceHandle Fd; - static string __relative_path; void set_relative_path(string path); string relative_path(); diff --git a/lib/fd.cc b/lib/fd.cc index eee5103..4f78252 100644 --- a/lib/fd.cc +++ b/lib/fd.cc @@ -529,6 +529,8 @@ namespace crucible { THROW_ERROR(runtime_error, "readlink: maximum buffer size exceeded"); } + static string __relative_path; + string relative_path() {