diff options
Diffstat (limited to '')
-rw-r--r-- | scd/scdaemon.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/scd/scdaemon.c b/scd/scdaemon.c index 26e89dd8d..bbb043334 100644 --- a/scd/scdaemon.c +++ b/scd/scdaemon.c @@ -29,9 +29,11 @@ #include <assert.h> #include <time.h> #include <fcntl.h> -#ifndef HAVE_W32_SYSTEM -#include <sys/socket.h> -#include <sys/un.h> +#ifdef HAVE_W32_SYSTEM +# include <direct.h> +#else +# include <sys/socket.h> +# include <sys/un.h> #endif /*HAVE_W32_SYSTEM*/ #include <unistd.h> #include <signal.h> @@ -811,6 +813,11 @@ main (int argc, char **argv ) #ifdef HAVE_W32_SYSTEM (void)csh_style; (void)nodetach; + if (_chdir("\\")) + { + log_error ("chdir to / failed: %s\n", strerror (errno)); + exit (1); + } #else pid = fork (); if (pid == (pid_t)-1) |