aboutsummaryrefslogtreecommitdiffstats
path: root/apps/sympathyd.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/sympathyd.c')
-rw-r--r--apps/sympathyd.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/apps/sympathyd.c b/apps/sympathyd.c
index 8bed929..a535ac6 100644
--- a/apps/sympathyd.c
+++ b/apps/sympathyd.c
@@ -10,13 +10,44 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.2 2008/02/07 15:42:49 james
+ * *** empty log message ***
+ *
* Revision 1.1 2008/02/05 14:25:49 james
* *** empty log message ***
*
*/
#include "sympathy.h"
+#include "ipc.h"
int main(int argc,char *argv[])
{
+int fd;
+struct sockaddr_un sun={0};
+
+fd=socket(PF_UNIX,SOCK_STREAM,0);
+if (fd<0) {
+ perror("socket");
+ exit(1);
+}
+
+sun.sun_family=AF_UNIX;
+strcpy(sun.sun_path,SOCKPATH);
+
+unlink(SOCKPATH);
+
+if (bind(fd,(struct sockaddr *) &sun,sizeof(sun))<0) {
+ perror("bind");
+ exit(1);
+}
+
+if (listen(fd,5)<0) {
+ perror("listen");
+ exit(1);
+}
+
+
+
+
}