]> git.ipfire.org Git - thirdparty/git.git/commit
compat-util: pretend that stub setitimer() always succeeds
authorJunio C Hamano <gitster@pobox.com>
Tue, 15 Dec 2020 21:26:17 +0000 (13:26 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Dec 2020 23:31:10 +0000 (15:31 -0800)
commit14639a47799461fbdb3bed6845c61a0ca0524200
tree1bcac11ca87f803eaaf3cba4841dccdd1d16fcc7
parent15b52a44e0c92a0658e891194a5b0610d1f53afc
compat-util: pretend that stub setitimer() always succeeds

When 15b52a44 (compat-util: type-check parameters of no-op
replacement functions, 2020-08-06) turned a handful of no-op
C-preprocessor macros into static inline functions to give the
callers a better type checking for their parameters, it forgot
to return anything from the stubbed out setitimer() function,
even though the function was defined to return an int just like the
real thing.

Since the original C-preprocessor macro implementation was to just
turn the call to the function an empty statement, we know that the
existing callers do not check the return value from it, and it does
not matter what value we return.  But it is safer to pretend that
the call succeeded by returning 0 than making it fail by returning -1
and clobbering errno with some value.

Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-compat-util.h