projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Give getsockopt() a reference to a socklen_t.
[tinc]
/
src
/
tincctl.c
diff --git
a/src/tincctl.c
b/src/tincctl.c
index
7a3195e
..
da66c8f
100644
(file)
--- a/
src/tincctl.c
+++ b/
src/tincctl.c
@@
-485,7
+485,7
@@
bool recvline(int fd, char *line, size_t len) {
while(!(newline = memchr(buffer, '\n', blen))) {
int result = recv(fd, buffer + blen, sizeof buffer - blen, 0);
while(!(newline = memchr(buffer, '\n', blen))) {
int result = recv(fd, buffer + blen, sizeof buffer - blen, 0);
- if(result == -1 && errno == EINTR)
+ if(result == -1 &&
sock
errno == EINTR)
continue;
else if(result <= 0)
return false;
continue;
else if(result <= 0)
return false;
@@
-511,7
+511,7
@@
bool recvdata(int fd, char *data, size_t len) {
while(blen < len) {
int result = recv(fd, buffer + blen, sizeof buffer - blen, 0);
while(blen < len) {
int result = recv(fd, buffer + blen, sizeof buffer - blen, 0);
- if(result == -1 && errno == EINTR)
+ if(result == -1 &&
sock
errno == EINTR)
continue;
else if(result <= 0)
return false;
continue;
else if(result <= 0)
return false;
@@
-543,7
+543,7
@@
bool sendline(int fd, char *format, ...) {
while(blen) {
int result = send(fd, p, blen, MSG_NOSIGNAL);
while(blen) {
int result = send(fd, p, blen, MSG_NOSIGNAL);
- if(result == -1 && errno == EINTR)
+ if(result == -1 &&
sock
errno == EINTR)
continue;
else if(result <= 0)
return false;
continue;
else if(result <= 0)
return false;
@@
-723,7
+723,7
@@
bool connect_tincd(bool verbose) {
if(getaddrinfo(host, port, &hints, &res) || !res) {
if(verbose)
if(getaddrinfo(host, port, &hints, &res) || !res) {
if(verbose)
- fprintf(stderr, "Cannot resolve %s port %s: %s", host, port, s
trerror(
errno));
+ fprintf(stderr, "Cannot resolve %s port %s: %s", host, port, s
ockstrerror(sock
errno));
return false;
}
return false;
}
@@
-1613,7
+1613,7
@@
static int cmd_config(int argc, char *argv[]) {
if(action < -1) {
if(!found)
fprintf(stderr, "No matching configuration variables found.\n");
if(action < -1) {
if(!found)
fprintf(stderr, "No matching configuration variables found.\n");
- return
0
;
+ return
1
;
}
// Make sure we wrote everything...
}
// Make sure we wrote everything...
@@
-1626,7
+1626,7
@@
static int cmd_config(int argc, char *argv[]) {
if(action < 0 && !removed) {
remove(tmpfile);
fprintf(stderr, "No configuration variables deleted.\n");
if(action < 0 && !removed) {
remove(tmpfile);
fprintf(stderr, "No configuration variables deleted.\n");
- return
*value != 0
;
+ return
1
;
}
// Replace the configuration file with the new one
}
// Replace the configuration file with the new one