Skip to content

Commit d91e81d

Browse files
save file
1 parent 89ba3f0 commit d91e81d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

blog/25-12-03/unix-sockets/ex/ipc-server-linux.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
#include <stdio.h>
88
#include <unistd.h>
99
#include <string.h>
10+
1011

11-
int main() {
12+
int main(){
1213

13-
int sock = socket(AF_UNIX, SOCK_STREAM, 0);
14+
int sock = socket(AF_UNIX,SOCK_STREAM,0);
1415
if(sock<0){
1516
perror("socket");
1617
return 1;
@@ -26,8 +27,8 @@
2627
strcpy(addr.sun_path,"/tmp/mysock");
2728

2829
if(bind(sock,(struct sockaddr*)&addr,sizeof(addr))<0){
29-
perror("bind");
30-
return 1;
30+
perror("bind");
31+
return 1;
3132
}
3233
listen(sock,1);
3334

0 commit comments

Comments
 (0)