--- gvpe/src/vped.C 2003/04/15 03:48:40 1.7 +++ gvpe/src/vped.C 2004/01/17 14:50:40 1.14 @@ -2,7 +2,7 @@ vped.C -- the main file for vped Copyright (C) 1998-2002 Ivo Timmermans 2000-2002 Guus Sliepen - 2003 Marc Lehmannn + 2003 Marc Lehmann This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -33,8 +34,11 @@ #include #include -#include +#if HAVE_SYS_MMAN_H +# include +#endif +#include #include #include "gettext.h" @@ -46,8 +50,6 @@ #include "vpn.h" #include "iom.h" -vpn network; - static loglevel llevel = L_NONE; /* If nonzero, display usage information and exit. */ @@ -56,10 +58,8 @@ /* If nonzero, print the version on standard output and exit. */ static int show_version; -#if HAVE_MLOCKALL /* If nonzero, disable swapping for this process. */ static int do_mlock = 0; -#endif /* If zero, don't detach from the terminal. */ static int do_detach = 1; @@ -71,9 +71,7 @@ {"version", no_argument, &show_version, 1}, {"no-detach", no_argument, &do_detach, 0}, {"log-level", required_argument, NULL, 'l'}, -#if HAVE_MLOCKALL {"mlock", no_argument, &do_mlock, 1}, -#endif {NULL, 0, NULL, 0} }; @@ -123,11 +121,9 @@ do_detach = 0; break; -#if HAVE_MLOCKALL case 'L': /* lock into memory */ do_mlock = 1; break; -#endif case 'l': /* inc debug level */ { @@ -211,6 +207,8 @@ int main (int argc, char **argv, char **envp) { + ERR_load_crypto_strings (); // we have the RAM + set_loglevel (L_INFO); set_identity (argv[0]); log_to (LOGTO_SYSLOG | LOGTO_STDERR); @@ -225,6 +223,7 @@ { printf (_("%s version %s (built %s %s, protocol %d.%d)\n"), get_identity (), VERSION, __DATE__, __TIME__, PROTOCOL_MAJOR, PROTOCOL_MINOR); + printf (_("Built with kernel interface %s/%s.\n"), IFTYPE, IFSUBTYPE); printf (_ ("Copyright (C) 2003 Marc Lehmann and others.\n" "See the AUTHORS file for a complete list.\n\n" @@ -242,7 +241,7 @@ /* Lock all pages into memory if requested */ -#if HAVE_MLOCKALL +#if HAVE_MLOCKALL && HAVE_SYS_MMAN_H && _POSIX_MEMLOCK if (do_mlock) if (mlockall (MCL_CURRENT | MCL_FUTURE)) slog (L_ERR, _("system call `%s' failed: %s"), "mlockall", strerror (errno));