Added few more stubs so that control reaches to DestroyDevice().
[mesa.git] / src / util / os_socket.c
index 98ef013205e5f9f328d88531e27b1c9c814680d8..6562cccaddd3edce2162ba9c7a3d7d7490e1c717 100644 (file)
@@ -33,10 +33,15 @@ os_socket_listen_abstract(const char *path, int count)
    int ret = bind(s, (struct sockaddr*)&addr,
                   offsetof(struct sockaddr_un, sun_path) +
                   strlen(path) + 1);
    int ret = bind(s, (struct sockaddr*)&addr,
                   offsetof(struct sockaddr_un, sun_path) +
                   strlen(path) + 1);
-   if (ret < 0)
+   if (ret < 0) {
+      close(s);
       return -1;
       return -1;
+   }
 
 
-   listen(s, count);
+   if (listen(s, count) < 0) {
+      close(s);
+      return -1;
+   }
 
    return s;
 }
 
    return s;
 }