about summary refs log tree commit diff
path: root/manual/examples
diff options
context:
space:
mode:
Diffstat (limited to 'manual/examples')
-rw-r--r--manual/examples/filecli.c2
-rw-r--r--manual/examples/filesrv.c4
-rw-r--r--manual/examples/mkfsock.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/manual/examples/filecli.c b/manual/examples/filecli.c
index b77ae6763e..9f64445fa9 100644
--- a/manual/examples/filecli.c
+++ b/manual/examples/filecli.c
@@ -24,7 +24,7 @@ main (void)
   sock = make_named_socket (CLIENT);
 
   /* Initialize the server socket address. */
-  name.sun_family = AF_UNIX;
+  name.sun_family = AF_LOCAL;
   strcpy (name.sun_path, SERVER);
   size = strlen (name.sun_path) + sizeof (name.sun_family);
 
diff --git a/manual/examples/filesrv.c b/manual/examples/filesrv.c
index 3596b99982..32507c6555 100644
--- a/manual/examples/filesrv.c
+++ b/manual/examples/filesrv.c
@@ -16,8 +16,10 @@ main (void)
   size_t size;
   int nbytes;
 
-  /* Make the socket, then loop endlessly. */
+  /* Remove the filename first, it's ok if the call fails */
+  unlink (SERVER);
 
+  /* Make the socket, then loop endlessly. */
   sock = make_named_socket (SERVER);
   while (1)
     {
diff --git a/manual/examples/mkfsock.c b/manual/examples/mkfsock.c
index 8683fbdc54..c6603af0ae 100644
--- a/manual/examples/mkfsock.c
+++ b/manual/examples/mkfsock.c
@@ -13,7 +13,7 @@ make_named_socket (const char *filename)
   size_t size;
 
   /* Create the socket.  */
-  sock = socket (PF_UNIX, SOCK_DGRAM, 0);
+  sock = socket (PF_LOCAL, SOCK_DGRAM, 0);
   if (sock < 0)
     {
       perror ("socket");