diff mbox

drm: Fix error message in drmWaitVBlank

Message ID 1364450740-10118-1-git-send-email-djkurtz@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Kurtz March 28, 2013, 6:05 a.m. UTC
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(-)

Comments

Jesse Barnes March 28, 2013, 3:34 p.m. UTC | #1
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.
diff mbox

Patch

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++;