The probers optionally use errno to communicate error details.
When a leftover errno is set from libblkid internally this can confuse
the probers.
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
if (id->probefunc) {
DBG(LOWPROBE, ul_debug(
"%s: ---> call probefunc()", id->name));
+ errno = 0;
rc = id->probefunc(pr, mag);
blkid_probe_prune_buffers(pr);
if (rc < 0) {
/* final check by probing function */
if (id->probefunc) {
DBG(LOWPROBE, ul_debug("\tcall probefunc()"));
+ errno = 0;
rc = id->probefunc(pr, mag);
blkid_probe_prune_buffers(pr);
if (rc != BLKID_PROBE_OK) {
if (id->probefunc) {
DBG(LOWPROBE, ul_debug("%s: call probefunc()", id->name));
+ errno = 0;
rc = id->probefunc(pr, NULL);
blkid_probe_prune_buffers(pr);
if (rc != 0)