Skip to content

Commit

Permalink
qemu-timer: Fix wrong error message
Browse files Browse the repository at this point in the history
Function timeSetEvent returns 0 when it fails, but it does not set
an error code which can be retrieved by GetLastError.

Therefore calling GetLastError is useless.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed May 14, 2012
1 parent 94d1991 commit 52ef651
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions qemu-timer.c
Expand Up @@ -635,8 +635,7 @@ static int mm_start_timer(struct qemu_alarm_timer *t)
TIME_ONESHOT | TIME_CALLBACK_FUNCTION);

if (!mm_timer) {
fprintf(stderr, "Failed to initialize win32 alarm timer: %ld\n",
GetLastError());
fprintf(stderr, "Failed to initialize win32 alarm timer\n");
timeEndPeriod(mm_tc.wPeriodMin);
return -1;
}
Expand Down Expand Up @@ -667,9 +666,7 @@ static void mm_rearm_timer(struct qemu_alarm_timer *t, int64_t delta)
TIME_ONESHOT | TIME_CALLBACK_FUNCTION);

if (!mm_timer) {
fprintf(stderr, "Failed to re-arm win32 alarm timer %ld\n",
GetLastError());

fprintf(stderr, "Failed to re-arm win32 alarm timer\n");
timeEndPeriod(mm_tc.wPeriodMin);
exit(1);
}
Expand Down

0 comments on commit 52ef651

Please sign in to comment.