mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
test: handle chdir errors correctly
When we get to this code, we already updated the environment variables so we need to use the usual error path to restore them. And where chdir does fail, print an error to the log. 256 chars should be enough here, if your tmpdir exceeds that you just have the error message cut off.
This commit is contained in:
parent
cf3c0431c3
commit
07c5511aed
1 changed files with 3 additions and 1 deletions
|
|
@ -936,8 +936,10 @@ static void run_test(struct pwtest_context *ctx, struct pwtest_suite *c, struct
|
|||
spa_assert_se(tmpdir != NULL);
|
||||
r = chdir(tmpdir);
|
||||
if (r < 0) {
|
||||
char *buf = pw_array_add(&t->logs[FD_LOG], 256);
|
||||
spa_scnprintf(buf, 256, "pwtest: failed to chdir to '%s'\n", tmpdir);
|
||||
t->sig_or_errno = -errno;
|
||||
return;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (t->args.pw_daemon) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue