1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 23:35:07 +00:00
serenity/Ports/make/patches/0002-Hardcode-default-path-because-confstr-is-missing.patch
2023-07-04 08:35:02 +02:00

31 lines
1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cameron Youell <cameronyouell@gmail.com>
Date: Mon, 27 Mar 2023 21:18:24 +1100
Subject: [PATCH] Hardcode default path because `confstr` is missing
---
src/job.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/job.c b/src/job.c
index ea885614a3862ea1a40d2ed12d78985c17d2ceb7..28d12a84cd9406633b4c8868fbc7527e07e56942 100644
--- a/src/job.c
+++ b/src/job.c
@@ -2430,6 +2430,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
/* execvp() will use a default PATH if none is set; emulate that. */
if (p == NULL)
{
+#ifndef __serenity__
size_t l = confstr (_CS_PATH, NULL, 0);
if (l)
{
@@ -2437,6 +2438,9 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
confstr (_CS_PATH, dp, l);
p = dp;
}
+#else
+ p = strdup("/bin:/usr/bin");
+#endif
}
cmd = (char *)find_in_given_path (argv[0], p, NULL, 0);