Commit-ID: 1c6fc0a5f82b9dca8828e623c82cc6eb6648d670 Gitweb: http://git.kernel.org/tip/1c6fc0a5f82b9dca8828e623c82cc6eb6648d670 Author: Pekka Enberg <penberg@xxxxxxxxxx> AuthorDate: Thu, 8 Mar 2012 14:37:37 +0200 Committer: Pekka Enberg <penberg@xxxxxxxxxx> CommitDate: Thu, 8 Mar 2012 14:37:37 +0200 kvm tools, sandbox: Fix running guest commands This patch fixes "vm sandbox" for guest commands that are not on host filesytem. Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx> --- tools/kvm/builtin-run.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index ff53e72..c8ae2f5 100644 --- a/tools/kvm/builtin-run.c +++ b/tools/kvm/builtin-run.c @@ -850,11 +850,11 @@ static void kvm_write_sandbox_cmd_exactly(int fd, const char *arg) static void resolve_program(const char *src, char *dst, size_t len) { struct stat st; + int err; - if (stat(src, &st) < 0) - die("Unable to resolve program %s: %s", src, strerror(errno)); + err = stat(src, &st); - if (S_ISREG(st.st_mode)) { + if (!err && S_ISREG(st.st_mode)) { char resolved_path[PATH_MAX]; realpath(src, resolved_path); -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html