A new user interface for you! Read more...

File Canna-oldsock.patch of Package Canna

diff -ruN Canna37p1.orig/lib/RKC/wconvert.c Canna37p1/lib/RKC/wconvert.c
--- Canna37p1.orig/lib/RKC/wconvert.c	2003-09-24 23:50:40.000000000 +0900
+++ Canna37p1/lib/RKC/wconvert.c	2004-04-30 19:10:18.762882047 +0900
@@ -150,8 +150,25 @@
     if ((ServerFD = socket((int) addr->sa_family, SOCK_STREAM, 0)) >= 0){
 	if( try_connect( ServerFD, addr, sizeof unaddr ) < 0 ) {
 	    close( ServerFD ) ;
-	    return( -1 ) ;
+	    ServerFD = -1;
+	}
+    }
+    if (ServerFD < 0) {
+	/* for the backward compatibility */
+#define OLD_IR_UNIX_PATH	"/tmp/.iroha_unix/IROHA"
+
+	if (number)
+	    sprintf (unaddr.sun_path, "%s:%d", OLD_IR_UNIX_PATH, number);
+	else
+	    strcpy (unaddr.sun_path, OLD_IR_UNIX_PATH);
+
+	if ((ServerFD = socket ((int) addr->sa_family, SOCK_STREAM, 0)) >= 0) {
+	    if (try_connect (ServerFD, addr, sizeof (unaddr)) < 0) {
+		close (ServerFD);
+		return -1;
+	    }
 	}
+#undef OLD_IR_UNIX_PATH
     }
     return( ServerFD ) ;
 }