From: Michel Daenzer Date: Wed, 23 Apr 2003 14:21:17 +0000 (+0000) Subject: deal correctly with read() from the DRM failing X-Git-Tag: submit/1.0/20121108.012404~2364 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=23a76c37594d3d423963c7b8610b64367e3ff9d8;p=profile%2Fivi%2Flibdrm.git deal correctly with read() from the DRM failing --- diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index e128092..a5bb805 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);