* [PATCH] drm: Fix error message in drmWaitVBlank
@ 2013-03-28 6:05 Daniel Kurtz
2013-03-28 15:34 ` Jesse Barnes
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Kurtz @ 2013-03-28 6:05 UTC (permalink / raw)
To: Jesse Barnes, dri-devel
If clock_gettime did fail, it would return -1 and set errno.
What we really want to strerror() is the errno.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
---
xf86drm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xf86drm.c b/xf86drm.c
index 2a74c80..4791a05 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -1946,7 +1946,7 @@ int drmWaitVBlank(int fd, drmVBlankPtr vbl)
ret = clock_gettime(CLOCK_MONOTONIC, &timeout);
if (ret < 0) {
- fprintf(stderr, "clock_gettime failed: %s\n", strerror(ret));
+ fprintf(stderr, "clock_gettime failed: %s\n", strerror(errno));
goto out;
}
timeout.tv_sec++;
--
1.8.1.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm: Fix error message in drmWaitVBlank
2013-03-28 6:05 [PATCH] drm: Fix error message in drmWaitVBlank Daniel Kurtz
@ 2013-03-28 15:34 ` Jesse Barnes
0 siblings, 0 replies; 2+ messages in thread
From: Jesse Barnes @ 2013-03-28 15:34 UTC (permalink / raw)
To: Daniel Kurtz; +Cc: dri-devel
On Thu, 28 Mar 2013 14:05:40 +0800
Daniel Kurtz <djkurtz@chromium.org> wrote:
> If clock_gettime did fail, it would return -1 and set errno.
> What we really want to strerror() is the errno.
>
> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
> ---
> xf86drm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xf86drm.c b/xf86drm.c
> index 2a74c80..4791a05 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -1946,7 +1946,7 @@ int drmWaitVBlank(int fd, drmVBlankPtr vbl)
>
> ret = clock_gettime(CLOCK_MONOTONIC, &timeout);
> if (ret < 0) {
> - fprintf(stderr, "clock_gettime failed: %s\n", strerror(ret));
> + fprintf(stderr, "clock_gettime failed: %s\n", strerror(errno));
> goto out;
> }
> timeout.tv_sec++;
Applied, thanks.
--
Jesse Barnes, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-28 15:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-28 6:05 [PATCH] drm: Fix error message in drmWaitVBlank Daniel Kurtz
2013-03-28 15:34 ` Jesse Barnes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox