From 23a76c37594d3d423963c7b8610b64367e3ff9d8 Mon Sep 17 00:00:00 2001 From: Michel Daenzer Date: Wed, 23 Apr 2003 14:21:17 +0000 Subject: [PATCH] deal correctly with read() from the DRM failing --- libdrm/xf86drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index e1280921..a5bb8050 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -1460,7 +1460,7 @@ static void drmSIGIOHandler(int interrupt, void *closure) #if 0 fprintf(stderr, "Trying %d\n", entry->fd); #endif - if ((count = read(entry->fd, buf, sizeof(buf)))) { + if ((count = read(entry->fd, buf, sizeof(buf))) > 0) { buf[count] = '\0'; #if 0 fprintf(stderr, "Got %s\n", buf);