mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-32776 plugin disks getmntinfo64 deprecated on macOS
The getmntinfo64 interface is deprected in MacOSX12.1.sdk. Using getmntinfo instead. Thanks heyingquay for reporting the bug and testing the fix.
This commit is contained in:
@ -4,7 +4,6 @@ CHECK_SYMBOL_EXISTS (getmntent "mntent.h" HAVE_GETMNTENT)
|
|||||||
CHECK_SYMBOL_EXISTS (getmntent "sys/mnttab.h" HAVE_GETMNTENT_IN_SYS_MNTAB)
|
CHECK_SYMBOL_EXISTS (getmntent "sys/mnttab.h" HAVE_GETMNTENT_IN_SYS_MNTAB)
|
||||||
CHECK_SYMBOL_EXISTS (setmntent "mntent.h" HAVE_SETMNTENT)
|
CHECK_SYMBOL_EXISTS (setmntent "mntent.h" HAVE_SETMNTENT)
|
||||||
CHECK_SYMBOL_EXISTS (getmntinfo "sys/types.h;sys/mount.h" HAVE_GETMNTINFO)
|
CHECK_SYMBOL_EXISTS (getmntinfo "sys/types.h;sys/mount.h" HAVE_GETMNTINFO)
|
||||||
CHECK_SYMBOL_EXISTS (getmntinfo64 "sys/types.h;sys/mount.h" HAVE_GETMNTINFO64)
|
|
||||||
|
|
||||||
IF (HAVE_GETMNTINFO)
|
IF (HAVE_GETMNTINFO)
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
@ -18,7 +17,7 @@ int main()
|
|||||||
" HAVE_GETMNTINFO_TAKES_statvfs)
|
" HAVE_GETMNTINFO_TAKES_statvfs)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF (HAVE_GETMNTENT OR HAVE_GETMNTENT_IN_SYS_MNTAB OR
|
IF (HAVE_GETMNTENT OR HAVE_GETMNTENT_IN_SYS_MNTAB OR
|
||||||
HAVE_GETMNTINFO OR HAVE_GETMNTINFO64)
|
HAVE_GETMNTINFO)
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql)
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql)
|
||||||
MYSQL_ADD_PLUGIN(DISKS information_schema_disks.cc MODULE_ONLY RECOMPILE_FOR_EMBEDDED)
|
MYSQL_ADD_PLUGIN(DISKS information_schema_disks.cc MODULE_ONLY RECOMPILE_FOR_EMBEDDED)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@ -37,8 +37,7 @@
|
|||||||
This intends to support *BSD's, macOS, Solaris, AIX, HP-UX, and Linux.
|
This intends to support *BSD's, macOS, Solaris, AIX, HP-UX, and Linux.
|
||||||
|
|
||||||
specificly:
|
specificly:
|
||||||
FreeBSD/OpenBSD/DragonFly (statfs) NetBSD (statvfs) uses getmntinfo().
|
FreeBSD/OpenBSD/DragonFly/macOS (statfs) NetBSD (statvfs) uses getmntinfo().
|
||||||
macOS uses getmntinfo64().
|
|
||||||
Linux can use getmntent_r(), but we've just used getmntent for simplification.
|
Linux can use getmntent_r(), but we've just used getmntent for simplification.
|
||||||
Linux/Solaris/AIX/HP-UX uses setmntent()/getmntent().
|
Linux/Solaris/AIX/HP-UX uses setmntent()/getmntent().
|
||||||
Solaris uses getmntent() with a diffent prototype, return structure, and
|
Solaris uses getmntent() with a diffent prototype, return structure, and
|
||||||
@ -46,8 +45,6 @@
|
|||||||
*/
|
*/
|
||||||
#if defined(HAVE_GETMNTINFO_TAKES_statvfs) || defined(HAVE_GETMNTENT)
|
#if defined(HAVE_GETMNTINFO_TAKES_statvfs) || defined(HAVE_GETMNTENT)
|
||||||
typedef struct statvfs st_info;
|
typedef struct statvfs st_info;
|
||||||
#elif defined(HAVE_GETMNTINFO64)
|
|
||||||
typedef struct statfs64 st_info;
|
|
||||||
#else // GETMNTINFO
|
#else // GETMNTINFO
|
||||||
typedef struct statfs st_info;
|
typedef struct statfs st_info;
|
||||||
#endif
|
#endif
|
||||||
@ -148,8 +145,6 @@ static int disks_fill_table(THD* pThd, TABLE_LIST* pTables, Item* pCond)
|
|||||||
|
|
||||||
#if defined(HAVE_GETMNTINFO_TAKES_statvfs)
|
#if defined(HAVE_GETMNTINFO_TAKES_statvfs)
|
||||||
count= getmntinfo(&s, ST_WAIT);
|
count= getmntinfo(&s, ST_WAIT);
|
||||||
#elif defined(HAVE_GETMNTINFO64)
|
|
||||||
count= getmntinfo64(&s, MNT_WAIT);
|
|
||||||
#else
|
#else
|
||||||
count= getmntinfo(&s, MNT_WAIT);
|
count= getmntinfo(&s, MNT_WAIT);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user