]> git.sesse.net Git - vlc/blobdiff - src/network/rootwrap.c
Fix warning
[vlc] / src / network / rootwrap.c
index d4d296f577bee6e4fe3f56e4d5d4d33fd2420776..08db8027b1e004378b3444c8cf2a8eb8253837f9 100644 (file)
@@ -18,7 +18,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 #if HAVE_CONFIG_H
 #include <netinet/in.h>
 #include <pthread.h>
 
+#if defined (AF_INET6) && !defined (IPV6_V6ONLY)
+# warning Uho, your IPv6 support is broken and has been disabled. Fix your C library.
+# undef AF_INET6
+#endif
+
+#ifndef AF_LOCAL
+# define AF_LOCAL AF_UNIX
+#endif
+
 /*#ifndef HAVE_CLEARENV
 extern char **environ;
 
@@ -194,9 +203,10 @@ static void rootprocess (int fd)
             const int val = 1;
 
             setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, &val, sizeof (val));
+#ifdef AF_INET6
             if (ss.ss_family == AF_INET6)
                 setsockopt (sock, IPPROTO_IPV6, IPV6_V6ONLY, &val, sizeof (val));
-
+#endif
             if (bind (sock, (struct sockaddr *)&ss, len) == 0)
             {
                 send_fd (fd, sock);
@@ -244,7 +254,7 @@ void rootwrap (void)
         exit (1);
     close (fd);
 
-    fputs ("Starting VLC root wrapper...", stderr);
+    fputs ("starting VLC root wrapper...", stderr);
 
     pw = guess_user ();
     if (pw == NULL)