aboutsummaryrefslogtreecommitdiffstats
path: root/agent/gpg-agent.c
diff options
context:
space:
mode:
Diffstat (limited to 'agent/gpg-agent.c')
-rw-r--r--agent/gpg-agent.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index efaebfd94..90e8a2657 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -39,6 +39,7 @@
# endif
# include <aclapi.h>
# include <sddl.h>
+# include <direct.h>
#else /*!HAVE_W32_SYSTEM*/
# include <sys/socket.h>
# include <sys/un.h>
@@ -1558,6 +1559,11 @@ main (int argc, char **argv )
(void)csh_style;
(void)nodetach;
initialize_modules ();
+ if (_chdir("\\"))
+ {
+ log_error ("chdir to / failed: %s\n", strerror (errno));
+ exit (1);
+ }
#else /*!HAVE_W32_SYSTEM*/