mirror of https://github.com/nirenjan/libx52.git
Allow libx52 calls to return TRY_AGAIN
Some libx52 APIs, notably the clock related ones, can return LIBX52_ERROR_TRY_AGAIN. This is not a real error, but it is useful information. It indicates to the application that there is no change applied to the internal state, and that it should wait until trying again. Given that the clock thread calls the libx52_set_clock method every second, treating the TRY_AGAIN state as a failure and logging it causes a lot of spurious noise in the logs. This change ensures that the API returns a real error before logging it.reverse-scroll
parent
6175dcabe6
commit
ae13480717
|
@ -132,8 +132,10 @@ void x52d_dev_exit(void)
|
||||||
rc = func; \
|
rc = func; \
|
||||||
pthread_mutex_unlock(&device_mutex); \
|
pthread_mutex_unlock(&device_mutex); \
|
||||||
if (rc != LIBX52_SUCCESS) { \
|
if (rc != LIBX52_SUCCESS) { \
|
||||||
PINELOG_ERROR(_("Error %d when updating X52 parameter: %s"), \
|
if (rc != LIBX52_ERROR_TRY_AGAIN) { \
|
||||||
rc, libx52_strerror(rc)); \
|
PINELOG_ERROR(_("Error %d when updating X52 parameter: %s"), \
|
||||||
|
rc, libx52_strerror(rc)); \
|
||||||
|
} \
|
||||||
} else { \
|
} else { \
|
||||||
device_update_needed = true; \
|
device_update_needed = true; \
|
||||||
} \
|
} \
|
||||||
|
|
Loading…
Reference in New Issue