Skip to content

Commit ebbfea0

Browse files
committed
Fix for CONPY-198:
Use CLOCK_MONOTONIC instead of CLOCK_MONOTOIC_RAW constant. The latter one exists for Linux only.
1 parent 21d2772 commit ebbfea0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mariadb/mariadb_connection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ PyObject *MrdbConnection_close(MrdbConnection *self)
652652
if (!rc)
653653
{
654654
self->inuse= 0;
655-
clock_gettime(CLOCK_MONOTONIC_RAW, &self->last_used);
655+
clock_gettime(CLOCK_MONOTONIC, &self->last_used);
656656
}
657657
pthread_mutex_unlock(&self->pool->lock);
658658
Py_INCREF(Py_None);

mariadb/mariadb_pooling.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ MrdbPool_initialize(MrdbPool *self, PyObject *args, PyObject *kwargs)
194194
{
195195
goto error;
196196
}
197-
clock_gettime(CLOCK_MONOTONIC_RAW, &self->connection[i]->last_used);
197+
clock_gettime(CLOCK_MONOTONIC, &self->connection[i]->last_used);
198198
self->connection[i]->pool= self;
199199
}
200200
self->connection_cnt= self->pool_size;
@@ -475,7 +475,7 @@ MrdbPool_addconnection(MrdbPool *self, PyObject *args)
475475
Py_INCREF(conn);
476476
self->connection[i]= conn;
477477
self->connection[i]->inuse= 0;
478-
clock_gettime(CLOCK_MONOTONIC_RAW, &self->connection[i]->last_used);
478+
clock_gettime(CLOCK_MONOTONIC, &self->connection[i]->last_used);
479479
conn->pool= self;
480480
pthread_mutex_unlock(&self->lock);
481481
Py_RETURN_NONE;

0 commit comments

Comments
 (0)