Suppress -Wdiscarded-qualifiers warning where fchdir is unusable

This commit is contained in:
Nobuyoshi Nakada 2023-04-04 11:27:43 +09:00
parent b2e848193a
commit 05b7bbecc6
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6
Notes: git 2023-04-04 03:30:56 +00:00

5
dir.c
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;