projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update the documentation of the tinc command.
[tinc]
/
src
/
tincctl.c
diff --git
a/src/tincctl.c
b/src/tincctl.c
index
f133e2d
..
83efc93
100644
(file)
--- a/
src/tincctl.c
+++ b/
src/tincctl.c
@@
-65,10
+65,8
@@
static bool force = false;
bool tty = true;
bool confbasegiven = false;
bool netnamegiven = false;
bool tty = true;
bool confbasegiven = false;
bool netnamegiven = false;
-
-#ifdef HAVE_MINGW
-static struct WSAData wsa_state;
-#endif
+char *scriptinterpreter = NULL;
+char *scriptextension = "";
static struct option const long_options[] = {
{"config", required_argument, NULL, 'c'},
static struct option const long_options[] = {
{"config", required_argument, NULL, 'c'},
@@
-680,14
+678,6
@@
bool connect_tincd(bool verbose) {
fclose(f);
fclose(f);
-#ifdef HAVE_MINGW
- if(WSAStartup(MAKEWORD(2, 2), &wsa_state)) {
- if(verbose)
- fprintf(stderr, "System call `%s' failed: %s", "WSAStartup", winerror(GetLastError()));
- return false;
- }
-#endif
-
#ifndef HAVE_MINGW
struct sockaddr_un sa;
sa.sun_family = AF_UNIX;
#ifndef HAVE_MINGW
struct sockaddr_un sa;
sa.sun_family = AF_UNIX;
@@
-1616,7
+1606,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;
+ return *value
!= 0
;
}
// Replace the configuration file with the new one
}
// Replace the configuration file with the new one
@@
-1749,7
+1739,7
@@
static int cmd_init(int argc, char *argv[]) {
return 1;
}
return 1;
}
- if(
strcmp(confdir, confbase)
&& mkdir(confdir, 0755) && errno != EEXIST) {
+ if(
!confbase_given
&& mkdir(confdir, 0755) && errno != EEXIST) {
fprintf(stderr, "Could not create directory %s: %s\n", confdir, strerror(errno));
return 1;
}
fprintf(stderr, "Could not create directory %s: %s\n", confdir, strerror(errno));
return 1;
}
@@
-1787,7
+1777,7
@@
static int cmd_init(int argc, char *argv[]) {
fprintf(stderr, "Could not create file %s: %s\n", filename, strerror(errno));
return 1;
}
fprintf(stderr, "Could not create file %s: %s\n", filename, strerror(errno));
return 1;
}
- fprintf(f, "#!/bin/sh\n\necho 'Unconfigured tinc-up script, please edit!'\n\n#ifconfig $INTERFACE <your vpn IP address> netmask <netmask of whole VPN>\n");
+ fprintf(f, "#!/bin/sh\n\necho 'Unconfigured tinc-up script, please edit
'$0'
!'\n\n#ifconfig $INTERFACE <your vpn IP address> netmask <netmask of whole VPN>\n");
fclose(f);
}
#endif
fclose(f);
}
#endif
@@
-2364,6
+2354,15
@@
int main(int argc, char *argv[]) {
return 0;
}
return 0;
}
+#ifdef HAVE_MINGW
+ static struct WSAData wsa_state;
+
+ if(WSAStartup(MAKEWORD(2, 2), &wsa_state)) {
+ fprintf(stderr, "System call `%s' failed: %s", "WSAStartup", winerror(GetLastError()));
+ return false;
+ }
+#endif
+
srand(time(NULL));
crypto_init();
srand(time(NULL));
crypto_init();