[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH v3 3/5] qemu-char: fix incorrect
From: |
Alex Bennée |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH v3 3/5] qemu-char: fix incorrect state in error message |
Date: |
Tue, 04 Nov 2014 13:31:06 +0000 |
zhanghailiang <address@hidden> writes:
> It is either "Failed _to_ do something", or "something failed",
> but not "failed something".
>
> Signed-off-by: zhanghailiang <address@hidden>
Semantically I'm fine to add:
Reviewed-by: Alex Bennée <address@hidden>
I'll leave it to the language pedants to rule on the grammar ;-)
> ---
> qemu-char.c | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/qemu-char.c b/qemu-char.c
> index a09bbf6..0f38cdd 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -1872,25 +1872,25 @@ static int win_chr_init(CharDriverState *chr, const
> char *filename)
>
> s->hsend = CreateEvent(NULL, TRUE, FALSE, NULL);
> if (!s->hsend) {
> - fprintf(stderr, "Failed CreateEvent\n");
> + fprintf(stderr, "CreateEvent failed\n");
> goto fail;
> }
> s->hrecv = CreateEvent(NULL, TRUE, FALSE, NULL);
> if (!s->hrecv) {
> - fprintf(stderr, "Failed CreateEvent\n");
> + fprintf(stderr, "CreateEvent failed\n");
> goto fail;
> }
>
> s->hcom = CreateFile(filename, GENERIC_READ|GENERIC_WRITE, 0, NULL,
> OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0);
> if (s->hcom == INVALID_HANDLE_VALUE) {
> - fprintf(stderr, "Failed CreateFile (%lu)\n", GetLastError());
> + fprintf(stderr, "CreateFile (%lu) failed\n", GetLastError());
> s->hcom = NULL;
> goto fail;
> }
>
> if (!SetupComm(s->hcom, NRECVBUF, NSENDBUF)) {
> - fprintf(stderr, "Failed SetupComm\n");
> + fprintf(stderr, "SetupComm failed\n");
> goto fail;
> }
>
> @@ -1901,23 +1901,23 @@ static int win_chr_init(CharDriverState *chr, const
> char *filename)
> CommConfigDialog(filename, NULL, &comcfg);
>
> if (!SetCommState(s->hcom, &comcfg.dcb)) {
> - fprintf(stderr, "Failed SetCommState\n");
> + fprintf(stderr, "SetCommState failed\n");
> goto fail;
> }
>
> if (!SetCommMask(s->hcom, EV_ERR)) {
> - fprintf(stderr, "Failed SetCommMask\n");
> + fprintf(stderr, "SetCommMask failed\n");
> goto fail;
> }
>
> cto.ReadIntervalTimeout = MAXDWORD;
> if (!SetCommTimeouts(s->hcom, &cto)) {
> - fprintf(stderr, "Failed SetCommTimeouts\n");
> + fprintf(stderr, "SetCommTimeouts failed\n");
> goto fail;
> }
>
> if (!ClearCommError(s->hcom, &err, &comstat)) {
> - fprintf(stderr, "Failed ClearCommError\n");
> + fprintf(stderr, "ClearCommError failed\n");
> goto fail;
> }
> qemu_add_polling_cb(win_chr_poll, chr);
> @@ -2069,12 +2069,12 @@ static int win_chr_pipe_init(CharDriverState *chr,
> const char *filename)
>
> s->hsend = CreateEvent(NULL, TRUE, FALSE, NULL);
> if (!s->hsend) {
> - fprintf(stderr, "Failed CreateEvent\n");
> + fprintf(stderr, "CreateEvent failed\n");
> goto fail;
> }
> s->hrecv = CreateEvent(NULL, TRUE, FALSE, NULL);
> if (!s->hrecv) {
> - fprintf(stderr, "Failed CreateEvent\n");
> + fprintf(stderr, "CreateEvent failed\n");
> goto fail;
> }
>
> @@ -2084,7 +2084,7 @@ static int win_chr_pipe_init(CharDriverState *chr,
> const char *filename)
> PIPE_WAIT,
> MAXCONNECT, NSENDBUF, NRECVBUF, NTIMEOUT,
> NULL);
> if (s->hcom == INVALID_HANDLE_VALUE) {
> - fprintf(stderr, "Failed CreateNamedPipe (%lu)\n", GetLastError());
> + fprintf(stderr, "CreateNamedPipe (%lu) failed\n", GetLastError());
> s->hcom = NULL;
> goto fail;
> }
> @@ -2093,13 +2093,13 @@ static int win_chr_pipe_init(CharDriverState *chr,
> const char *filename)
> ov.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
> ret = ConnectNamedPipe(s->hcom, &ov);
> if (ret) {
> - fprintf(stderr, "Failed ConnectNamedPipe\n");
> + fprintf(stderr, "ConnectNamedPipe failed\n");
> goto fail;
> }
>
> ret = GetOverlappedResult(s->hcom, &ov, &size, TRUE);
> if (!ret) {
> - fprintf(stderr, "Failed GetOverlappedResult\n");
> + fprintf(stderr, "GetOverlappedResult failed\n");
> if (ov.hEvent) {
> CloseHandle(ov.hEvent);
> ov.hEvent = NULL;
--
Alex Bennée