1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

support: Preserve errno in write_message, TEST_VERIFY and other checks

These facilities could clobber errno, which makes it difficult to write
certain checks because a specific order has to be used.
This commit is contained in:
Florian Weimer
2018-01-12 08:18:30 +01:00
parent 63b52889c3
commit 1a51e46e4a
5 changed files with 21 additions and 0 deletions

View File

@@ -18,14 +18,17 @@
#include <support/check.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
void
support_test_verify_impl (const char *file, int line, const char *expr)
{
int saved_errno = errno;
support_record_failure ();
printf ("error: %s:%d: not true: %s\n", file, line, expr);
errno = saved_errno;
}
void