Files
MINGW-packages/mingw-w64-python-psutil/0003-avoid-symbol-errors.patch
dragon-archer d72bf45862 python-psutil: update to 7.2.1
* fix all 3 patches
	* align patch offsets to new source code
	* handle several file renames
	* add mincore to linked libs for QueryInterruptTime
	* fix conflicting function prototypes
* make check() runnable
2026-01-14 12:24:53 +07:00

67 lines
2.2 KiB
Diff

--- a/psutil/_psutil_windows.c
+++ b/psutil/_psutil_windows.c
@@ -25,6 +25,8 @@
#define GETSTATE(m) ((struct module_state *)PyModule_GetState(m))
+PyObject *TimeoutExpired;
+PyObject *TimeoutAbandoned;
// ------------------------ Python init ---------------------------
--- a/psutil/arch/windows/proc.c
+++ b/psutil/arch/windows/proc.c
@@ -27,8 +27,8 @@
// Raised by Process.wait().
-PyObject *TimeoutExpired;
-PyObject *TimeoutAbandoned;
+PyObject *TimeoutExpired2;
+PyObject *TimeoutAbandoned2;
/*
@@ -127,7 +127,7 @@
}
if (retVal == WAIT_TIMEOUT) {
PyErr_SetString(
- TimeoutExpired, "WaitForSingleObject() returned WAIT_TIMEOUT"
+ TimeoutExpired2, "WaitForSingleObject() returned WAIT_TIMEOUT"
);
CloseHandle(hProcess);
return NULL;
@@ -135,7 +135,7 @@
if (retVal == WAIT_ABANDONED) {
psutil_debug("WaitForSingleObject() -> WAIT_ABANDONED");
PyErr_SetString(
- TimeoutAbandoned, "WaitForSingleObject() returned WAIT_ABANDONED"
+ TimeoutAbandoned2, "WaitForSingleObject() returned WAIT_ABANDONED"
);
CloseHandle(hProcess);
return NULL;
--- a/psutil/arch/windows/init.h
+++ b/psutil/arch/windows/init.h
@@ -59,8 +59,6 @@
PVOID psutil_GetProcAddressFromLib(LPCSTR libname, LPCSTR procname);
PVOID psutil_SetFromNTStatusErr(NTSTATUS status, const char *syscall);
-PyObject *TimeoutExpired;
-PyObject *TimeoutAbandoned;
int _psutil_pids(DWORD **pids_array, int *pids_count);
@@ -86,10 +84,10 @@
PyObject *psutil_disk_io_counters(PyObject *self, PyObject *args);
PyObject *psutil_disk_partitions(PyObject *self, PyObject *args);
PyObject *psutil_disk_usage(PyObject *self, PyObject *args);
-PyObject *psutil_get_loadavg();
+PyObject *psutil_get_loadavg(PyObject *self, PyObject *args);
PyObject *psutil_get_open_files(DWORD pid, HANDLE hProcess);
PyObject *psutil_getpagesize(PyObject *self, PyObject *args);
-PyObject *psutil_init_loadavg_counter();
+PyObject *psutil_init_loadavg_counter(PyObject *self, PyObject *args);
PyObject *psutil_heap_info(PyObject *self, PyObject *args);
PyObject *psutil_heap_trim(PyObject *self, PyObject *args);
PyObject *psutil_net_connections(PyObject *self, PyObject *args);