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

systemd / systemd / 18668483236

20 Oct 2025 10:56PM UTC coverage: 72.32% (+0.06%) from 72.264%
18668483236

push

github

yuwata
hwdb: Add V64x_V65xAU to list of Clevo models where scancode f7+f8 get mapped to touchpad-toggle

Fn + F1 which is the shortcut for toggling the touchpad on/off sends
atkbd scancodes f7 (first press) + f8 (second press) just like on various
other Clevo models. Add the V64x_V65xAU model to the list of models where
these scancodes are mapped to touchpad-toggle.

304594 of 421177 relevant lines covered (72.32%)

1093501.54 hits per line

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

51.16
/src/basic/iovec-wrapper.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2

3
#include <stdio.h>
4

5
#include "alloc-util.h"
6
#include "iovec-util.h"
7
#include "iovec-wrapper.h"
8
#include "string-util.h"
9

10
struct iovec_wrapper *iovw_new(void) {
24✔
11
        return new0(struct iovec_wrapper, 1);
24✔
12
}
13

14
void iovw_done(struct iovec_wrapper *iovw) {
25,583✔
15
        assert(iovw);
25,583✔
16

17
        iovw->iovec = mfree(iovw->iovec);
25,583✔
18
        iovw->count = 0;
25,583✔
19
}
25,583✔
20

21
void iovw_done_free(struct iovec_wrapper *iovw) {
27✔
22
        assert(iovw);
27✔
23

24
        FOREACH_ARRAY(i, iovw->iovec, iovw->count)
828✔
25
                iovec_done(i);
801✔
26

27
        iovw_done(iovw);
27✔
28
}
27✔
29

30
struct iovec_wrapper *iovw_free_free(struct iovec_wrapper *iovw) {
15✔
31
        if (!iovw)
15✔
32
                return NULL;
33

34
        iovw_done_free(iovw);
15✔
35
        return mfree(iovw);
15✔
36
}
37

38
struct iovec_wrapper *iovw_free(struct iovec_wrapper *iovw) {
×
39
        if (!iovw)
×
40
                return NULL;
41

42
        iovw_done(iovw);
×
43
        return mfree(iovw);
×
44
}
45

46
int iovw_put(struct iovec_wrapper *iovw, void *data, size_t len) {
642,477✔
47
        assert(iovw);
642,477✔
48

49
        if (len == 0)
642,477✔
50
                return 0;
51

52
        assert(data);
642,477✔
53

54
        if (iovw->count >= IOV_MAX)
642,477✔
55
                return -E2BIG;
56

57
        if (!GREEDY_REALLOC(iovw->iovec, iovw->count + 1))
642,477✔
58
                return -ENOMEM;
59

60
        iovw->iovec[iovw->count++] = IOVEC_MAKE(data, len);
642,477✔
61
        return 0;
642,477✔
62
}
63

64
int iovw_put_string_field_full(struct iovec_wrapper *iovw, bool replace, const char *field, const char *value) {
438✔
65
        _cleanup_free_ char *x = NULL;
438✔
66
        int r;
438✔
67

68
        assert(iovw);
438✔
69

70
        x = strjoin(field, value);
438✔
71
        if (!x)
438✔
72
                return -ENOMEM;
73

74
        if (replace)
438✔
75
                FOREACH_ARRAY(iovec, iovw->iovec, iovw->count)
×
76
                        if (memory_startswith(iovec->iov_base, iovec->iov_len, field)) {
×
77
                                iovec->iov_len = strlen(x);
×
78
                                free_and_replace(iovec->iov_base, x);
×
79
                                return 0;
×
80
                        }
81

82
        r = iovw_put(iovw, x, strlen(x));
438✔
83
        if (r >= 0)
438✔
84
                TAKE_PTR(x);
438✔
85

86
        return r;
87
}
88

89
int iovw_put_string_fieldf_full(struct iovec_wrapper *iovw, bool replace, const char *field, const char *format, ...) {
×
90
        _cleanup_free_ char *value = NULL;
×
91
        va_list ap;
×
92
        int r;
×
93

94
        assert(format);
×
95

96
        va_start(ap, format);
×
97
        r = vasprintf(&value, format, ap);
×
98
        va_end(ap);
×
99
        if (r < 0)
×
100
                return -ENOMEM;
101

102
        return iovw_put_string_field_full(iovw, replace, field, value);
×
103
}
104

105
int iovw_put_string_field_free(struct iovec_wrapper *iovw, const char *field, char *value) {
235✔
106
        _cleanup_free_ _unused_ char *free_ptr = value;
235✔
107

108
        return iovw_put_string_field(iovw, field, value);
235✔
109
}
110

111
void iovw_rebase(struct iovec_wrapper *iovw, void *old, void *new) {
2,370✔
112
        assert(iovw);
2,370✔
113

114
        FOREACH_ARRAY(i, iovw->iovec, iovw->count) {
24,135✔
115
                assert(i->iov_base >= old);
21,765✔
116
                i->iov_base = (uint8_t*) i->iov_base - (uint8_t*) old + (uint8_t*) new;
21,765✔
117
        }
118
}
2,370✔
119

120
size_t iovw_size(const struct iovec_wrapper *iovw) {
×
121
        if (!iovw)
×
122
                return 0;
123

124
        return iovec_total_size(iovw->iovec, iovw->count);
×
125
}
126

127
int iovw_append(struct iovec_wrapper *target, const struct iovec_wrapper *source) {
×
128
        size_t original_count;
×
129
        int r;
×
130

131
        assert(target);
×
132

133
        /* This duplicates the source and merges it into the target. */
134

135
        if (iovw_isempty(source))
×
136
                return 0;
137

138
        original_count = target->count;
×
139

140
        FOREACH_ARRAY(iovec, source->iovec, source->count) {
×
141
                void *dup;
×
142

143
                dup = memdup(iovec->iov_base, iovec->iov_len);
×
144
                if (!dup) {
×
145
                        r = -ENOMEM;
×
146
                        goto rollback;
×
147
                }
148

149
                r = iovw_consume(target, dup, iovec->iov_len);
×
150
                if (r < 0)
×
151
                        goto rollback;
×
152
        }
153

154
        return 0;
155

156
rollback:
×
157
        for (size_t i = original_count; i < target->count; i++)
×
158
                iovec_done(target->iovec + i);
×
159

160
        target->count = original_count;
×
161
        return r;
×
162
}
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