• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

systemd / systemd / 14939761809

09 May 2025 06:22PM UTC coverage: 72.251% (-0.001%) from 72.252%
14939761809

push

github

web-flow
mount-tool: honor arg_canonicalize for ACTION_UMOUNT path_is_absolute() check too (#37398)

Split out from #36337

4 of 4 new or added lines in 2 files covered. (100.0%)

3591 existing lines in 114 files now uncovered.

297546 of 411820 relevant lines covered (72.25%)

704170.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

72.0
/src/basic/assert-util.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2

3
#include <limits.h>
4
#include <stdio.h>
5

6
#include "assert-util.h"
7
#include "errno-util.h"
8
#include "log.h"
9

10
static bool assert_return_is_critical = BUILD_MODE_DEVELOPER;
11

12
/* Akin to glibc's __abort_msg; which is private and we hence cannot
13
 * use here. */
14
static char *log_abort_msg = NULL;
15

16
void log_set_assert_return_is_critical(bool b) {
1,161✔
17
        assert_return_is_critical = b;
1,161✔
18
}
1,161✔
19

20
bool log_get_assert_return_is_critical(void) {
386✔
21
        return assert_return_is_critical;
386✔
22
}
23

24
static void log_assert(
378✔
25
        int level,
26
        const char *text,
27
        const char *file,
28
        int line,
29
        const char *func,
30
        const char *format) {
31

32
        static char buffer[LINE_MAX];
378✔
33

34
        if (_likely_(LOG_PRI(level) > log_get_max_level()))
378✔
35
                return;
36

37
        DISABLE_WARNING_FORMAT_NONLITERAL;
378✔
38
        (void) snprintf(buffer, sizeof buffer, format, text, file, line, func);
378✔
39
        REENABLE_WARNING;
378✔
40

41
        log_abort_msg = buffer;
378✔
42

43
        log_dispatch_internal(level, 0, file, line, func, NULL, NULL, NULL, NULL, buffer);
378✔
44
}
45

46
_noreturn_ void log_assert_failed(const char *text, const char *file, int line, const char *func) {
×
UNCOV
47
        log_assert(LOG_CRIT, text, file, line, func,
×
48
                   "Assertion '%s' failed at %s:%u, function %s(). Aborting.");
UNCOV
49
        abort();
×
50
}
51

52
_noreturn_ void log_assert_failed_unreachable(const char *file, int line, const char *func) {
×
UNCOV
53
        log_assert(LOG_CRIT, "Code should not be reached", file, line, func,
×
54
                   "%s at %s:%u, function %s(). Aborting. 💥");
UNCOV
55
        abort();
×
56
}
57

58
void log_assert_failed_return(const char *text, const char *file, int line, const char *func) {
378✔
59

60
        if (assert_return_is_critical)
378✔
UNCOV
61
                log_assert_failed(text, file, line, func);
×
62

63
        PROTECT_ERRNO;
378✔
64
        log_assert(LOG_DEBUG, text, file, line, func,
378✔
65
                   "Assertion '%s' failed at %s:%u, function %s(), ignoring.");
66
}
378✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc