vserver 1.9.3
[linux-2.6.git] / arch / um / drivers / mcast_user.c
index 58e5db6..0fe1d9f 100644 (file)
@@ -23,6 +23,7 @@
 #include "kern_util.h"
 #include "user_util.h"
 #include "user.h"
+#include "os.h"
 
 #define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER)
 
@@ -62,7 +63,8 @@ static int mcast_open(void *data)
                goto out;
        }
 
-       if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0){
+       fd = socket(AF_INET, SOCK_DGRAM, 0);
+       if (fd < 0){
                printk("mcast_open : data socket failed, errno = %d\n", 
                       errno);
                fd = -ENOMEM;
@@ -72,7 +74,7 @@ static int mcast_open(void *data)
        if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0) {
                printk("mcast_open: SO_REUSEADDR failed, errno = %d\n",
                        errno);
-               close(fd);
+               os_close_file(fd);
                fd = -EINVAL;
                goto out;
        }
@@ -82,7 +84,7 @@ static int mcast_open(void *data)
                       sizeof(pri->ttl)) < 0) {
                printk("mcast_open: IP_MULTICAST_TTL failed, error = %d\n",
                        errno);
-               close(fd);
+               os_close_file(fd);
                fd = -EINVAL;
                goto out;
        }
@@ -91,7 +93,7 @@ static int mcast_open(void *data)
        if (setsockopt(fd, SOL_IP, IP_MULTICAST_LOOP, &yes, sizeof(yes)) < 0) {
                printk("mcast_open: IP_MULTICAST_LOOP failed, error = %d\n",
                        errno);
-               close(fd);
+               os_close_file(fd);
                fd = -EINVAL;
                goto out;
        }
@@ -99,7 +101,7 @@ static int mcast_open(void *data)
        /* bind socket to mcast address */
        if (bind(fd, (struct sockaddr *) sin, sizeof(*sin)) < 0) {
                printk("mcast_open : data bind failed, errno = %d\n", errno);
-               close(fd);
+               os_close_file(fd);
                fd = -EINVAL;
                goto out;
        }               
@@ -115,7 +117,7 @@ static int mcast_open(void *data)
                       "interface on the host.\n");
                printk("eth0 should be configured in order to use the "
                       "multicast transport.\n");
-               close(fd);
+               os_close_file(fd);
                fd = -EINVAL;
        }
 
@@ -137,7 +139,7 @@ static void mcast_close(int fd, void *data)
                        errno);
        }
 
-       close(fd);
+       os_close_file(fd);
 }
 
 int mcast_user_write(int fd, void *buf, int len, struct mcast_data *pri)