diff options
author | Jiri Denemark <jdenemar@redhat.com> | 2014-06-24 10:50:10 +0200 |
---|---|---|
committer | Jiri Denemark <jdenemar@redhat.com> | 2014-06-26 00:43:38 +0200 |
commit | a4743860f8d0d638d5ddf0f8d321c93486e155e5 (patch) | |
tree | 6bd730bb9a9ee93d2204de2c826764d12bcd4d09 /tools | |
parent | ca3d9afeb11c5a55f8e59e7f3d92e80aee0e5f90 (diff) | |
download | libvirt-a4743860f8d0d638d5ddf0f8d321c93486e155e5.tar.gz |
virsh: Remove bogus stat on log file
Let's just open the file right away and deal with errors. Moreover,
there's no reason to forbid logging to, e.g., a pipe.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/virsh.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/tools/virsh.c b/tools/virsh.c index 1bac84281a..3927120e15 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -2794,29 +2794,9 @@ vshInit(vshControl *ctl) void vshOpenLogFile(vshControl *ctl) { - struct stat st; - if (ctl->logfile == NULL) return; - /* check log file */ - if (stat(ctl->logfile, &st) == -1) { - switch (errno) { - case ENOENT: - break; - default: - vshError(ctl, "%s", - _("failed to get the log file information")); - exit(EXIT_FAILURE); - } - } else { - if (!S_ISREG(st.st_mode)) { - vshError(ctl, "%s", _("the log path is not a file")); - exit(EXIT_FAILURE); - } - } - - /* log file open */ if ((ctl->log_fd = open(ctl->logfile, LOGFILE_FLAGS, FILE_MODE)) < 0) { vshError(ctl, "%s", _("failed to open the log file. check the log file path")); |