You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
855 B
25 lines
855 B
From 2d1a6a5665492cc0a71554045b2293e1193c889b Mon Sep 17 00:00:00 2001 |
|
From: Frantisek Sumsal <fsumsal@redhat.com> |
|
Date: Wed, 27 Feb 2019 19:51:48 +0100 |
|
Subject: [PATCH] machinectl: check correct FD for a return value |
|
|
|
Found by LGTM. |
|
|
|
Resolves: #1694605 |
|
--- |
|
src/machine/machinectl.c | 2 +- |
|
1 file changed, 1 insertion(+), 1 deletion(-) |
|
|
|
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c |
|
index 1a58aeaf11..66b64e1feb 100644 |
|
--- a/src/machine/machinectl.c |
|
+++ b/src/machine/machinectl.c |
|
@@ -1086,7 +1086,7 @@ static int copy_files(int argc, char *argv[], void *userdata) { |
|
return r; |
|
|
|
hostfd = open(host_dirname, O_CLOEXEC|O_RDONLY|O_NOCTTY|O_DIRECTORY); |
|
- if (r < 0) |
|
+ if (hostfd < 0) |
|
return log_error_errno(errno, "Failed to open source directory: %m"); |
|
|
|
child = fork();
|
|
|