swanctl: Fix exit codes based on errno
authorMartin Willi <martin@revosec.ch>
Thu, 9 Oct 2014 14:48:29 +0000 (16:48 +0200)
committerMartin Willi <martin@revosec.ch>
Fri, 10 Oct 2014 09:42:18 +0000 (11:42 +0200)
commit67f9f09dd3aec23f8ebc514220c53833996dd1ea
tree725d2f77744e47d950c673aa61963542d1ea38db
parentd4d85135c5713f3bddebdc5ccc3c0bf0fa4b022a
swanctl: Fix exit codes based on errno

As fprintf() most likely sets errno, we should save it before printing the
error message.
13 files changed:
src/swanctl/command.c
src/swanctl/commands/initiate.c
src/swanctl/commands/install.c
src/swanctl/commands/list_certs.c
src/swanctl/commands/list_conns.c
src/swanctl/commands/list_pols.c
src/swanctl/commands/list_pools.c
src/swanctl/commands/list_sas.c
src/swanctl/commands/log.c
src/swanctl/commands/reload_settings.c
src/swanctl/commands/stats.c
src/swanctl/commands/terminate.c
src/swanctl/commands/version.c