mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-17 14:04:52 +02:00
Use longer random names for SHM to make double unlink safe
This commit is contained in:
@@ -341,6 +341,10 @@ PyInit_fast_data_types(void) {
|
||||
PyModule_AddIntMacro(m, APC);
|
||||
PyModule_AddIntMacro(m, OSC);
|
||||
PyModule_AddIntMacro(m, FILE_TRANSFER_CODE);
|
||||
// FreeBSD's man page says this is 1023. Linux says its PATH_MAX.
|
||||
// Apple says its SHM_NAME_MAX but SHM_NAME_MAX is not actually declared in typical CrApple style.
|
||||
// Experimentation shows that 1023 is allowed on macOS Catalina
|
||||
PyModule_AddIntConstant(m, "SHM_NAME_MAX", MIN(1023, PATH_MAX));
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user