chiark / gitweb /
*** empty log message ***
[sympathy.git] / apps / sympathyd.c
1 /*
2  * sympathy.c:
3  *
4  * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
5  * All rights reserved.
6  *
7  */
8
9 static char rcsid[] = "$Id$";
10
11 /*
12  * $Log$
13  * Revision 1.2  2008/02/07 15:42:49  james
14  * *** empty log message ***
15  *
16  * Revision 1.1  2008/02/05 14:25:49  james
17  * *** empty log message ***
18  *
19  */
20
21 #include "sympathy.h"
22 #include "ipc.h"
23
24 int main(int argc,char *argv[])
25 {
26 int fd;
27 struct sockaddr_un sun={0};
28
29 fd=socket(PF_UNIX,SOCK_STREAM,0);
30 if (fd<0) {
31         perror("socket");
32         exit(1);
33 }
34
35 sun.sun_family=AF_UNIX;
36 strcpy(sun.sun_path,SOCKPATH);
37
38 unlink(SOCKPATH);
39
40 if (bind(fd,(struct sockaddr *) &sun,sizeof(sun))<0)  {
41         perror("bind");
42         exit(1);
43 }
44
45 if (listen(fd,5)<0) {
46         perror("listen");
47         exit(1);
48 }
49
50
51
52
53 }