like:
src/shared/install.c: In function ‘unit_file_lookup_state’:
src/shared/install.c:1861:16: warning: ‘r’ may be used uninitialized in
this function [-Wmaybe-uninitialized]
return r < 0 ? r : state;
^
src/shared/install.c:1796:13: note: ‘r’ was declared here
int r;
^
27 files changed:
- if (curl_easy_getinfo(curl, CURLINFO_PRIVATE, &j) != CURLE_OK)
+ if (curl_easy_getinfo(curl, CURLINFO_PRIVATE, (char **)&j) != CURLE_OK)
return;
if (!j || j->state == PULL_JOB_DONE || j->state == PULL_JOB_FAILED)
return;
if (!j || j->state == PULL_JOB_DONE || j->state == PULL_JOB_FAILED)
RequestMeta *m = connection_cls;
int r;
_cleanup_free_ char* hostname = NULL, *os_name = NULL;
RequestMeta *m = connection_cls;
int r;
_cleanup_free_ char* hostname = NULL, *os_name = NULL;
- uint64_t cutoff_from = 0, cutoff_to = 0, usage;
+ uint64_t cutoff_from = 0, cutoff_to = 0, usage = 0;
char *json;
sd_id128_t mid, bid;
_cleanup_free_ char *v = NULL;
char *json;
sd_id128_t mid, bid;
_cleanup_free_ char *v = NULL;
switch(source->state) {
case STATE_LINE: {
char *line, *sep;
switch(source->state) {
case STATE_LINE: {
char *line, *sep;
assert(source->data_size == 0);
assert(source->data_size == 0);
static int add_source(RemoteServer *s, int fd, char* name, bool own_name) {
static int add_source(RemoteServer *s, int fd, char* name, bool own_name) {
+ RemoteSource *source = NULL;
int r;
/* This takes ownership of name, even on failure, if own_name is true. */
int r;
/* This takes ownership of name, even on failure, if own_name is true. */
.size = sizeof(union sockaddr_union),
.type = SOCK_STREAM,
};
.size = sizeof(union sockaddr_union),
.type = SOCK_STREAM,
};
fd2 = accept_connection("raw", fd, &addr, &hostname);
if (fd2 < 0)
fd2 = accept_connection("raw", fd, &addr, &hostname);
if (fd2 < 0)
int catalog_get(const char* database, sd_id128_t id, char **_text) {
_cleanup_close_ int fd = -1;
void *p = NULL;
int catalog_get(const char* database, sd_id128_t id, char **_text) {
_cleanup_close_ int fd = -1;
void *p = NULL;
char *text = NULL;
int r;
const char *s;
char *text = NULL;
int r;
const char *s;
static int make_filename(const char *info[_INFO_LEN], char **ret) {
_cleanup_free_ char *c = NULL, *u = NULL, *p = NULL, *t = NULL;
static int make_filename(const char *info[_INFO_LEN], char **ret) {
_cleanup_free_ char *c = NULL, *u = NULL, *p = NULL, *t = NULL;
/* Optionally store the entire coredump in the journal */
if (IN_SET(arg_storage, COREDUMP_STORAGE_JOURNAL, COREDUMP_STORAGE_BOTH) &&
coredump_size <= (off_t) arg_journal_size_max) {
/* Optionally store the entire coredump in the journal */
if (IN_SET(arg_storage, COREDUMP_STORAGE_JOURNAL, COREDUMP_STORAGE_BOTH) &&
coredump_size <= (off_t) arg_journal_size_max) {
/* Store the coredump itself in the journal */
/* Store the coredump itself in the journal */
if (o->object.flags & OBJECT_COMPRESSION_MASK) {
#if defined(HAVE_XZ) || defined(HAVE_LZ4)
uint64_t l;
if (o->object.flags & OBJECT_COMPRESSION_MASK) {
#if defined(HAVE_XZ) || defined(HAVE_LZ4)
uint64_t l;
l = le64toh(o->object.size);
if (l <= offsetof(Object, data.payload))
l = le64toh(o->object.size);
if (l <= offsetof(Object, data.payload))
#if defined(HAVE_XZ) || defined(HAVE_LZ4)
if (f->compress_xz &&
size >= COMPRESSION_SIZE_THRESHOLD) {
#if defined(HAVE_XZ) || defined(HAVE_LZ4)
if (f->compress_xz &&
size >= COMPRESSION_SIZE_THRESHOLD) {
compression = compress_blob(data, size, o->data.payload, &rsize);
compression = compress_blob(data, size, o->data.payload, &rsize);
if (o->object.flags & OBJECT_COMPRESSION_MASK) {
#if defined(HAVE_XZ) || defined(HAVE_LZ4)
if (o->object.flags & OBJECT_COMPRESSION_MASK) {
#if defined(HAVE_XZ) || defined(HAVE_LZ4)
r = decompress_blob(o->object.flags & OBJECT_COMPRESSION_MASK,
o->data.payload, l, &from->compress_buffer, &from->compress_buffer_size, &rsize, 0);
r = decompress_blob(o->object.flags & OBJECT_COMPRESSION_MASK,
o->data.payload, l, &from->compress_buffer, &from->compress_buffer_size, &rsize, 0);
unsigned long long *realtime) {
_cleanup_free_ const char *path = NULL;
unsigned long long *realtime) {
_cleanup_free_ const char *path = NULL;
/* The timestamp was determined by the file name, but let's
* see if the file might actually be older than the file name
/* The timestamp was determined by the file name, but let's
* see if the file might actually be older than the file name
ORDERED_HASHMAP_FOREACH(f, j->files, i) {
int k;
ORDERED_HASHMAP_FOREACH(f, j->files, i) {
int k;
- usec_t first, validated, last;
+ usec_t first = 0, validated = 0, last = 0;
#ifdef HAVE_GCRYPT
if (!arg_verify_key && JOURNAL_HEADER_SEALED(f->header))
#ifdef HAVE_GCRYPT
if (!arg_verify_key && JOURNAL_HEADER_SEALED(f->header))
const void *d;
char *k, *c;
size_t l;
const void *d;
char *k, *c;
size_t l;
assert_se(sd_journal_get_cursor(j, &k) >= 0);
printf("cursor: %s\n", k);
assert_se(sd_journal_get_cursor(j, &k) >= 0);
printf("cursor: %s\n", k);
}
int tlv_packet_read_u8(tlv_packet *m, uint8_t *data) {
}
int tlv_packet_read_u8(tlv_packet *m, uint8_t *data) {
int r;
assert_return(m, -EINVAL);
int r;
assert_return(m, -EINVAL);
int tlv_packet_read_u16(tlv_packet *m, uint16_t *data) {
uint16_t t;
int tlv_packet_read_u16(tlv_packet *m, uint16_t *data) {
uint16_t t;
int r;
assert_return(m, -EINVAL);
int r;
assert_return(m, -EINVAL);
}
int tlv_packet_read_string(tlv_packet *m, char **data, uint16_t *data_length) {
}
int tlv_packet_read_string(tlv_packet *m, char **data, uint16_t *data_length) {
int r;
assert_return(m, -EINVAL);
int r;
assert_return(m, -EINVAL);
}
int tlv_packet_read_bytes(tlv_packet *m, uint8_t **data, uint16_t *data_length) {
}
int tlv_packet_read_bytes(tlv_packet *m, uint8_t **data, uint16_t *data_length) {
int r;
assert_return(m, -EINVAL);
int r;
assert_return(m, -EINVAL);
if (pool_offset >= 0 &&
server->bound_leases[pool_offset] == existing_lease) {
DHCPLease *lease;
if (pool_offset >= 0 &&
server->bound_leases[pool_offset] == existing_lease) {
DHCPLease *lease;
if (!existing_lease) {
lease = new0(DHCPLease, 1);
if (!existing_lease) {
lease = new0(DHCPLease, 1);
static int pppoe_arm_timeout(sd_pppoe *ppp) {
_cleanup_event_source_unref_ sd_event_source *timeout = NULL;
static int pppoe_arm_timeout(sd_pppoe *ppp) {
_cleanup_event_source_unref_ sd_event_source *timeout = NULL;
+ usec_t next_timeout = 0;
}
_public_ int sd_peer_get_session(int fd, char **session) {
}
_public_ int sd_peer_get_session(int fd, char **session) {
+ struct ucred ucred = {};
int r;
assert_return(fd >= 0, -EINVAL);
int r;
assert_return(fd >= 0, -EINVAL);
return r;
} else if (streq(a, "_TTL")) {
return r;
} else if (streq(a, "_TTL")) {
+ long long unsigned x = 0;
usec_t time;
r = safe_atollu(b, &x);
usec_t time;
r = safe_atollu(b, &x);
fd = dns_scope_tcp_socket(t->scope, t->received->family, &t->received->sender, t->received->sender_port);
else {
union in_addr_union address;
fd = dns_scope_tcp_socket(t->scope, t->received->family, &t->received->sender, t->received->sender_port);
else {
union in_addr_union address;
+ int family = AF_UNSPEC;
/* Otherwise, try to talk to the owner of a
* the IP address, in case this is a reverse
/* Otherwise, try to talk to the owner of a
* the IP address, in case this is a reverse
static void test_dns_name_reverse_one(const char *address, const char *name) {
_cleanup_free_ char *p = NULL;
static void test_dns_name_reverse_one(const char *address, const char *name) {
_cleanup_free_ char *p = NULL;
- union in_addr_union a, b;
+ union in_addr_union a, b = {};
int familya, familyb;
assert_se(in_addr_from_string_auto(address, &familya, &a) >= 0);
int familya, familyb;
assert_se(in_addr_from_string_auto(address, &familya, &a) >= 0);
int base_filesystem_create(const char *root) {
_cleanup_close_ int fd = -1;
unsigned i;
int base_filesystem_create(const char *root) {
_cleanup_close_ int fd = -1;
unsigned i;
fd = open(root, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW);
if (fd < 0)
fd = open(root, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW);
if (fd < 0)
_cleanup_free_ char *p = NULL, *loop = NULL, *backing = NULL;
_cleanup_close_ int loop_fd = -1, backing_fd = -1;
struct stat st;
_cleanup_free_ char *p = NULL, *loop = NULL, *backing = NULL;
_cleanup_close_ int loop_fd = -1, backing_fd = -1;
struct stat st;
int r;
/* btrfs cannot handle file systems < 16M, hence use this as minimum */
int r;
/* btrfs cannot handle file systems < 16M, hence use this as minimum */
static thread_local unsigned long saved;
static thread_local bool valid = false;
_cleanup_free_ char *content = NULL;
static thread_local unsigned long saved;
static thread_local bool valid = false;
_cleanup_free_ char *content = NULL;
}
int copy_file(const char *from, const char *to, int flags, mode_t mode, unsigned chattr_flags) {
}
int copy_file(const char *from, const char *to, int flags, mode_t mode, unsigned chattr_flags) {
assert(from);
assert(to);
assert(from);
assert(to);
}
int copy_file_atomic(const char *from, const char *to, mode_t mode, bool replace, unsigned chattr_flags) {
}
int copy_file_atomic(const char *from, const char *to, mode_t mode, bool replace, unsigned chattr_flags) {
- _cleanup_free_ char *t;
+ _cleanup_free_ char *t = NULL;
int copy_times(int fdf, int fdt) {
struct timespec ut[2];
struct stat st;
int copy_times(int fdf, int fdt) {
struct timespec ut[2];
struct stat st;
assert(fdf >= 0);
assert(fdt >= 0);
assert(fdf >= 0);
assert(fdt >= 0);
UnitFileState state = _UNIT_FILE_STATE_INVALID;
char **i;
_cleanup_free_ char *path = NULL;
UnitFileState state = _UNIT_FILE_STATE_INVALID;
char **i;
_cleanup_free_ char *path = NULL;
if (warn_cutoff && line < how_many && not_before > 0) {
sd_id128_t boot_id;
if (warn_cutoff && line < how_many && not_before > 0) {
sd_id128_t boot_id;
/* Check whether the cutoff line is too early */
/* Check whether the cutoff line is too early */
int getttyname_harder(int fd, char **r) {
int k;
int getttyname_harder(int fd, char **r) {
int k;
k = getttyname_malloc(fd, &s);
if (k < 0)
k = getttyname_malloc(fd, &s);
if (k < 0)
/* If $FOO appears as single word, replace it by the split up variable */
if ((*i)[0] == '$' && (*i)[1] != '{') {
char *e;
/* If $FOO appears as single word, replace it by the split up variable */
if ((*i)[0] == '$' && (*i)[1] != '{') {
char *e;
unsigned q;
e = strv_env_get(env, *i+1);
unsigned q;
e = strv_env_get(env, *i+1);
char **tests_path = STRV_MAKE("exists", "existsglobFOOBAR", "changed", "modified", "unit",
"directorynotempty", "makedirectory");
char **test_path;
char **tests_path = STRV_MAKE("exists", "existsglobFOOBAR", "changed", "modified", "unit",
"directorynotempty", "makedirectory");
char **test_path;
static void test_pty(void) {
pid_t pid;
static void test_pty(void) {
pid_t pid;
rcvsiz = 0;
zero(rcvbuf);
rcvsiz = 0;
zero(rcvbuf);
int link_get_driver(link_config_ctx *ctx, struct udev_device *device, char **ret) {
const char *name;
int link_get_driver(link_config_ctx *ctx, struct udev_device *device, char **ret) {
const char *name;
int r;
name = udev_device_get_sysname(device);
int r;
name = udev_device_get_sysname(device);