projects
/
uzbl-mobile
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote branch 'remotes/uzbl/master'
[uzbl-mobile]
/
uzblctrl.c
diff --git
a/uzblctrl.c
b/uzblctrl.c
index
93584bc
..
2547bc7
100644
(file)
--- a/
uzblctrl.c
+++ b/
uzblctrl.c
@@
-33,27
+33,27
@@
main(int argc, char* argv[]) {
int s, len;
struct sockaddr_un remote;
char tmp;
int s, len;
struct sockaddr_un remote;
char tmp;
-
+
if ((s = socket (AF_UNIX, SOCK_STREAM, 0)) == -1) {
perror ("socket");
if ((s = socket (AF_UNIX, SOCK_STREAM, 0)) == -1) {
perror ("socket");
- exit (1);
+ exit (EXIT_FAILURE);
}
}
-
+
remote.sun_family = AF_UNIX;
strcpy (remote.sun_path, (char *) sockpath);
len = strlen (remote.sun_path) + sizeof (remote.sun_family);
remote.sun_family = AF_UNIX;
strcpy (remote.sun_path, (char *) sockpath);
len = strlen (remote.sun_path) + sizeof (remote.sun_family);
-
+
if (connect (s, (struct sockaddr *) &remote, len) == -1) {
perror ("connect");
if (connect (s, (struct sockaddr *) &remote, len) == -1) {
perror ("connect");
- exit (1);
+ exit (EXIT_FAILURE);
}
}
-
+
if ((send (s, command, strlen (command), 0) == -1) ||
(send (s, "\n", 1, 0) == -1)) {
perror ("send");
if ((send (s, command, strlen (command), 0) == -1) ||
(send (s, "\n", 1, 0) == -1)) {
perror ("send");
- exit (1);
+ exit (EXIT_FAILURE);
}
}
-
+
while ((len = recv (s, &tmp, 1, 0))) {
putchar(tmp);
if (tmp == '\n')
while ((len = recv (s, &tmp, 1, 0))) {
putchar(tmp);
if (tmp == '\n')
@@
-61,7
+61,7
@@
main(int argc, char* argv[]) {
}
close(s);
}
close(s);
-
+
return 0;
} else {
fprintf(stderr, "Usage: uzblctrl -s /path/to/socket -c \"command\"");
return 0;
} else {
fprintf(stderr, "Usage: uzblctrl -s /path/to/socket -c \"command\"");