Subversion Repositories Mokou

Rev

Rev 11 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11 Rev 12
Line 1... Line 1...
1
/* $Id: main.c 11 2024-09-07 10:07:49Z nishi $ */
1
/* $Id: main.c 12 2024-09-07 10:18:01Z nishi $ */
2
 
2
 
3
#include <sys/types.h>
3
#include <sys/types.h>
4
#include <sys/socket.h>
4
#include <sys/socket.h>
5
#include <sys/un.h>
5
#include <sys/un.h>
6
 
6
 
Line 60... Line 60...
60
		sun.sun_family = AF_LOCAL;
60
		sun.sun_family = AF_LOCAL;
61
		strcpy(sun.sun_path, "/tmp/mokou.sock");
61
		strcpy(sun.sun_path, "/tmp/mokou.sock");
62
		if(connect(sock, (struct sockaddr*)&sun, sizeof(sun)) == -1){
62
		if(connect(sock, (struct sockaddr*)&sun, sizeof(sun)) == -1){
63
			fprintf(stderr, "Connection failure: %s\n", strerror(errno));
63
			fprintf(stderr, "Connection failure: %s\n", strerror(errno));
64
			close(sock);
64
			close(sock);
-
 
65
			return 1;
65
		}
66
		}
66
		send(sock, msg, strlen(msg), 0);
67
		send(sock, msg, strlen(msg), 0);
67
		
68
		
68
		char cbuf[2];
69
		char cbuf[2];
69
		cbuf[1] = 0;
70
		cbuf[1] = 0;