diff options
Diffstat (limited to 'Modules/faulthandler.c')
-rw-r--r-- | Modules/faulthandler.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index b0df93c..f49993d 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -22,7 +22,9 @@ # define FAULTHANDLER_USER #endif -#define PUTS(fd, str) write(fd, str, strlen(str)) +/* cast size_t to int because write() takes an int on Windows + (anyway, the length is smaller than 30 characters) */ +#define PUTS(fd, str) write(fd, str, (int)strlen(str)) #ifdef HAVE_SIGACTION typedef struct sigaction _Py_sighandler_t; @@ -445,7 +447,7 @@ faulthandler_thread(void *unused) /* get the thread holding the GIL, NULL if no thread hold the GIL */ current = _Py_atomic_load_relaxed(&_PyThreadState_Current); - write(thread.fd, thread.header, thread.header_len); + write(thread.fd, thread.header, (int)thread.header_len); errmsg = _Py_DumpTracebackThreads(thread.fd, thread.interp, current); ok = (errmsg == NULL); |