Suppress -Wdiscarded-qualifiers warning where fchdir is unusable

This commit is contained in:
Nobuyoshi Nakada committed 2023-04-04 11:27:43 +09:00
1 parent b2e848193a
commit 05b7bbecc6
1 file changed
+2 -3
Notes: git 2026-01-31 09:36:28 +00:00
+2 -3
View File
@@ -1277,9 +1277,8 @@ dir_chdir(VALUE dir)
#if defined(HAVE_FCHDIR) && defined(HAVE_DIRFD) && HAVE_FCHDIR && HAVE_DIRFD
dir_s_fchdir(rb_cDir, dir_fileno(dir));
#else
struct dir_data *dirp;
dirp = dir_get(dir);
dir_s_chdir(1, &dirp->path, rb_cDir);
VALUE path = dir_get(dir)->path;
dir_s_chdir(1, &path, rb_cDir);
#endif
return Qnil;