summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-05-21 10:30:21 +0100
committerLinus Groh <mail@linusgroh.de>2021-05-21 10:30:52 +0100
commitd60ebbbba6429bf7f3ce58783acd8232d487d4b9 (patch)
treeea37facb5b78f0bd73402bcc2a869c2ee4b9528a /Userland/Libraries/LibC
parent68f76b9e3750c8f4e5e3ee8c3d346772ce6d3593 (diff)
downloadserenity-d60ebbbba6429bf7f3ce58783acd8232d487d4b9.zip
Revert "Userland: static vs non-static constexpr variables"
This reverts commit 800ea8ea969835297dc7e7da345a45b9dc5e751a. Booting the system no longer worked after these changes.
Diffstat (limited to 'Userland/Libraries/LibC')
-rw-r--r--Userland/Libraries/LibC/netdb.cpp4
-rw-r--r--Userland/Libraries/LibC/time.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/Userland/Libraries/LibC/netdb.cpp b/Userland/Libraries/LibC/netdb.cpp
index 33d17b5a21..77d0b790dd 100644
--- a/Userland/Libraries/LibC/netdb.cpp
+++ b/Userland/Libraries/LibC/netdb.cpp
@@ -36,7 +36,7 @@ static constexpr i32 lookup_server_endpoint_magic = 9001;
// Get service entry buffers and file information for the getservent() family of functions.
static FILE* services_file = nullptr;
-static constexpr char services_path[] = "/etc/services";
+static const char* services_path = "/etc/services";
static bool fill_getserv_buffers(const char* line, ssize_t read);
static servent __getserv_buffer;
@@ -50,7 +50,7 @@ static ssize_t service_file_offset = 0;
// Get protocol entry buffers and file information for the getprotent() family of functions.
static FILE* protocols_file = nullptr;
-static constexpr char protocols_path[] = "/etc/protocols";
+static const char* protocols_path = "/etc/protocols";
static bool fill_getproto_buffers(const char* line, ssize_t read);
static protoent __getproto_buffer;
diff --git a/Userland/Libraries/LibC/time.cpp b/Userland/Libraries/LibC/time.cpp
index 738d8ea594..9add36bb76 100644
--- a/Userland/Libraries/LibC/time.cpp
+++ b/Userland/Libraries/LibC/time.cpp
@@ -70,9 +70,10 @@ char* ctime_r(const time_t* t, char* buf)
return asctime_r(localtime_r(t, &tm_buf), buf);
}
+static const int __seconds_per_day = 60 * 60 * 24;
+
static void time_to_tm(struct tm* tm, time_t t)
{
- constexpr int __seconds_per_day = 60 * 60 * 24;
int year = 1970;
for (; t >= days_in_year(year) * __seconds_per_day; ++year)
t -= days_in_year(year) * __seconds_per_day;