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

systemd / systemd / 14554080340

19 Apr 2025 11:46AM UTC coverage: 72.101% (-0.03%) from 72.13%
14554080340

push

github

web-flow
Add two new paragraphs to coding style about header files (#37188)

296880 of 411754 relevant lines covered (72.1%)

687547.52 hits per line

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

87.88
/src/sysupdate/sysupdate-instance.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2

3
#include <fcntl.h>
4
#include <sys/stat.h>
5

6
#include "log.h"
7
#include "sysupdate-instance.h"
8

9
void instance_metadata_destroy(InstanceMetadata *m) {
50,898✔
10
        assert(m);
50,898✔
11
        free(m->version);
50,898✔
12
}
50,898✔
13

14
int instance_new(
3,062✔
15
                Resource *rr,
16
                const char *path,
17
                const InstanceMetadata *f,
18
                Instance **ret) {
19

20
        _cleanup_(instance_freep) Instance *i = NULL;
×
21
        _cleanup_free_ char *p = NULL, *v = NULL;
3,062✔
22

23
        assert(rr);
3,062✔
24
        assert(path);
3,062✔
25
        assert(f);
3,062✔
26
        assert(f->version);
3,062✔
27
        assert(ret);
3,062✔
28

29
        p = strdup(path);
3,062✔
30
        if (!p)
3,062✔
31
                return log_oom();
×
32

33
        v = strdup(f->version);
3,062✔
34
        if (!v)
3,062✔
35
                return log_oom();
×
36

37
        i = new(Instance, 1);
3,062✔
38
        if (!i)
3,062✔
39
                return log_oom();
×
40

41
        *i = (Instance) {
3,062✔
42
                .resource = rr,
43
                .metadata = *f,
3,062✔
44
                .path = TAKE_PTR(p),
3,062✔
45
                .partition_info = PARTITION_INFO_NULL,
46
        };
47

48
        i->metadata.version = TAKE_PTR(v);
3,062✔
49

50
        *ret = TAKE_PTR(i);
3,062✔
51
        return 0;
3,062✔
52
}
53

54
Instance *instance_free(Instance *i) {
3,062✔
55
        if (!i)
3,062✔
56
                return NULL;
57

58
        instance_metadata_destroy(&i->metadata);
3,062✔
59

60
        free(i->path);
3,062✔
61
        partition_info_destroy(&i->partition_info);
3,062✔
62

63
        return mfree(i);
3,062✔
64
}
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