Skip to content

Commit

Permalink
Merge pull request #1549 from saschagrunert/unused-result
Browse files Browse the repository at this point in the history
Fix warning around unused result on chdir("/")
  • Loading branch information
giuseppe authored Sep 5, 2024
2 parents 841a0de + 23d5e49 commit df78c16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libcrun/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -5773,7 +5773,10 @@ libcrun_safe_chdir (const char *path, libcrun_error_t *err)
/* Enforce that the returned path is an absolute path. */
if (ret == 0 || buffer[0] != '/')
{
(void) chdir ("/");
if (chdir ("/") < 0)
{
/* Braces around empty body, to fix warning for [-Wunused-result] and error for [-Werror=empty-body]. */
}
errno = ENOENT;

/*
Expand Down

1 comment on commit df78c16

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.