For instance, if the specified path doesn't exist.

Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com>
---
 shmfd.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/shmfd.c b/shmfd.c
index 45b9067..4dee9de 100644
--- a/shmfd.c
+++ b/shmfd.c
@@ -95,6 +95,10 @@ main (int argc, char **argv)
        uint32_t                size = WIDTH * HEIGHT * 4;
 
        fd = make_shm(size, &addr);     /* some memory */
+       if (fd < 0) {
+               perror("make_shm");
+               exit(1);
+       }
        paint(addr, WIDTH, HEIGHT, 0);
        printf ("painted\n");
        c = xcb_connect(NULL, &screen_num);
-- 
1.7.9.2

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to