Informix Error -438
-438 Call back function must be NULL if time-out value is -1.
You provided an incorrect value to unregister your callback function. Pass a null value, not a function pointer, to the callback function.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-438 is the mirror-image restriction of -436: when the time-out value is -1 (indefinite
wait, or effectively "unregister"), the callback function argument must be NULL — a non-null
function pointer combined with -1 is rejected, just as a bounded time-out with a missing
callback is rejected by -436.
- A callback function pointer supplied alongside a time-out of
-1— the direct, only cause, typically when unregistering a callback. - Application code that reuses a previous bounded-time-out registration call's arguments
when actually intending to unregister (switch to
-1), without also clearing the callback argument toNULL.
Solutions / Resolution
- Pass
NULLfor the callback function whenever the time-out value is-1, per the official guidance. - When unregistering a callback (switching to
-1), clear the callback argument toNULLin the same change, rather than reusing a prior bounded-time-out call's arguments.
Examples
Correctly unregistering with NULL
int timeout = -1;
/* register_callback(timeout, NULL); */
The disallowed combination
int timeout = -1;
/* register_callback(timeout, callback_fn); */
/* -438: callback_fn must be NULL when timeout is -1 */
Diagnostic Checks
- Check whether the callback argument is
NULLwhenever the time-out value is-1.
Related Errors / Related Topics
- -436 — "Call back function must be defined when time-out value is 0 or greater." The mirror-image restriction — together these two errors define the valid combinations for this time-out/callback mechanism.
- -435 — "Time-out value must be -1 or greater." The base restriction on the time-out argument's valid range.
Time-out -1 always pairs with a NULL callback — clear the callback argument explicitly when
switching a registration to indefinite wait / unregistering.