disinclined.org
/
git
/
irssi-notify.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b675636
)
Fixed bug in client which didn't send the null byte. added fork for notify-send
author
Dylan Lloyd
<dylan@dylansserver.com>
Sun, 29 Jan 2012 19:43:23 +0000
(14:43 -0500)
committer
Dylan Lloyd
<dylan@dylansserver.com>
Sun, 29 Jan 2012 19:43:23 +0000
(14:43 -0500)
client.c
patch
|
blob
|
history
server.c
patch
|
blob
|
history
diff --git
a/client.c
b/client.c
index
57078dc
..
463dd38
100644
(file)
--- a/
client.c
+++ b/
client.c
@@
-36,8
+36,8
@@
int main(int argc, char *argv[])
int rv;
char s[INET6_ADDRSTRLEN];
- if (argc !=
2
) {
- fprintf(stderr,"usage: client hostname\n");
+ if (argc !=
3
) {
+ fprintf(stderr,"usage: client hostname
'message'
\n");
exit(1);
}
@@
-72,7
+72,7
@@
int main(int argc, char *argv[])
return 2;
}
- if (send(sockfd,
"Hello, world!", 13
, 0) == -1)
+ if (send(sockfd,
argv[2], strlen(argv[2])+1
, 0) == -1)
perror("send");
printf("connected\n");
diff --git
a/server.c
b/server.c
index
1da2bcd
..
df70fb4
100644
(file)
--- a/
server.c
+++ b/
server.c
@@
-122,6
+122,8
@@
int main(void)
}
buf[100] = '\0';
printf("server: recieved '%s'\n", buf);
+ if (!fork())
+ execl("/home/dylan/test", "irssi", buf, NULL);
close(new_fd);
exit(0);
}