OSDN Git Service

deal correctly with read() from the DRM failing
authorMichel Daenzer <michel@daenzer.net>
Wed, 23 Apr 2003 14:21:17 +0000 (14:21 +0000)
committerMichel Daenzer <michel@daenzer.net>
Wed, 23 Apr 2003 14:21:17 +0000 (14:21 +0000)
libdrm/xf86drm.c

index e128092..a5bb805 100644 (file)
@@ -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);