summaryrefslogtreecommitdiff
path: root/src/shared/copy.c
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2015-03-27 12:02:49 +0100
committerHarald Hoyer <harald@redhat.com>2015-03-27 14:57:38 +0100
commita7f7d1bde43fc825c49afea3f946f5b4b3d563e0 (patch)
treee6202adf568f95dbf22d7fb0c51f8c9220a56964 /src/shared/copy.c
parent47d45d3cde45d6545367570264e4e3636bc9e345 (diff)
fix gcc warnings about uninitialized variables
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; ^
Diffstat (limited to 'src/shared/copy.c')
-rw-r--r--src/shared/copy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shared/copy.c b/src/shared/copy.c
index 9e4c3b0f7..775a33985 100644
--- a/src/shared/copy.c
+++ b/src/shared/copy.c
@@ -360,7 +360,7 @@ int copy_file_fd(const char *from, int fdt, bool try_reflink) {
}
int copy_file(const char *from, const char *to, int flags, mode_t mode, unsigned chattr_flags) {
- int fdt, r;
+ int fdt = -1, r;
assert(from);
assert(to);
@@ -390,7 +390,7 @@ int copy_file(const char *from, const char *to, int flags, mode_t mode, unsigned
}
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 r;
assert(from);
@@ -421,7 +421,7 @@ int copy_file_atomic(const char *from, const char *to, mode_t mode, bool replace
int copy_times(int fdf, int fdt) {
struct timespec ut[2];
struct stat st;
- usec_t crtime;
+ usec_t crtime = 0;
assert(fdf >= 0);
assert(fdt >= 0);