X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fsocket-util.c;h=24e8f8101df2203b4c958d328f3819c6020fdec3;hb=66105f0e2cbd40d64bb80d77fff9c65014577050;hp=7e4b8be84be8a96c074d581b8d3ee13d41ba51fd;hpb=2401d853a400babaa2c7254851e751d3db9af8cb;p=sliver-openvswitch.git diff --git a/lib/socket-util.c b/lib/socket-util.c index 7e4b8be84..24e8f8101 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -306,18 +306,11 @@ make_sockaddr_un(const char *name, struct sockaddr_un *un, socklen_t *un_len, static int bind_unix_socket(int fd, struct sockaddr *sun, socklen_t sun_len) { -#ifdef __linux__ - /* On Linux, calling fchmod() *before* bind() sets permissions for the file - * about to be created. Calling fchmod() *after* bind has no effect on the - * file that was created.) */ - return fchmod(fd, 0700) || bind(fd, sun, sun_len) ? errno : 0; -#else /* According to _Unix Network Programming_, umask should affect bind(). */ mode_t old_umask = umask(0077); int error = bind(fd, sun, sun_len) ? errno : 0; umask(old_umask); return error; -#endif } /* Creates a Unix domain socket in the given 'style' (either SOCK_DGRAM or