From: Jake Freeland <jake@technologyfriends.net>
To: igt-dev@lists.freedesktop.org
Cc: Jake Freeland <jfree@freebsd.org>
Subject: [igt-dev] [PATCH i-g-t] Replaced get_current_dir_name() with getcwd() for BSD compatibility
Date: Sun, 18 Sep 2022 17:39:55 -0500 [thread overview]
Message-ID: <20220918223955.3283220-1-jfree@freebsd.org> (raw)
Signed-off-by: Jake Freeland <jfree@freebsd.org>
---
tests/tools_test.c | 6 +++---
tools/i915-perf/i915_perf_control.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/tools_test.c b/tests/tools_test.c
index 89a19d11..d0684d57 100644
--- a/tests/tools_test.c
+++ b/tests/tools_test.c
@@ -69,7 +69,7 @@ static bool chdir_to_tools_dir(void)
char path[PATH_MAX];
char *cwd;
- cwd = get_current_dir_name();
+ cwd = getcwd(NULL, 0);
igt_info("Current working directory: %s\n", cwd);
free(cwd);
@@ -87,7 +87,7 @@ static bool chdir_to_tools_dir(void)
chdir(dirname(path));
}
- cwd = get_current_dir_name();
+ cwd = getcwd(NULL, 0);
igt_info("Current working directory: %s\n", cwd);
free(cwd);
@@ -103,7 +103,7 @@ igt_main
igt_require_f(chdir_to_tools_dir(),
"Unable to determine the tools directory, expecting them in $cwd/" TOOLS " or $path/" TOOLS "\n");
- path = get_current_dir_name();
+ path = getcwd(NULL, 0);
igt_info("Using tools from %s\n", path);
free(path);
}
diff --git a/tools/i915-perf/i915_perf_control.c b/tools/i915-perf/i915_perf_control.c
index be5996c0..f7db2f5c 100644
--- a/tools/i915-perf/i915_perf_control.c
+++ b/tools/i915-perf/i915_perf_control.c
@@ -102,7 +102,7 @@ main(int argc, char *argv[])
fwrite(data, total_len, 1, command_fifo_file);
} else {
- char *cwd = get_current_dir_name();
+ char *cwd = getcwd(NULL, 0);
uint32_t path_len = strlen(cwd) + 1 + strlen(dump_file) + 1;
uint32_t total_len = sizeof(struct recorder_command_base) + path_len;
struct {
--
2.37.3
next reply other threads:[~2022-09-18 22:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-18 22:39 Jake Freeland [this message]
2022-09-19 1:54 ` [igt-dev] ✓ Fi.CI.BAT: success for Replaced get_current_dir_name() with getcwd() for BSD compatibility Patchwork
2022-09-19 4:45 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-09-28 12:40 ` [igt-dev] [PATCH i-g-t] " Kamil Konieczny
2022-09-28 14:30 ` Jake Freeland
2022-09-28 19:36 Jake Freeland
2022-10-05 8:22 ` Kamil Konieczny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220918223955.3283220-1-jfree@freebsd.org \
--to=jake@technologyfriends.net \
--cc=igt-dev@lists.freedesktop.org \
--cc=jfree@freebsd.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.