Log HTTP responses if option -d is given twice
[pazpar2-moved-to-github.git] / src / pazpar2.c
index f51fa9e..f4bec6c 100644 (file)
@@ -22,6 +22,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #endif
 #ifdef WIN32
 #include <winsock.h>
+#include <direct.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
 #endif
 
 #include <signal.h>
@@ -119,7 +123,7 @@ static int sc_main(
        switch (ret)
         {
         case 'd':
-            global_parameters.dump_records = 1;
+            global_parameters.dump_records++;
             break;
         case 'D':
             daemon = 1;
@@ -154,7 +158,13 @@ static int sc_main(
             show_version();
             break;
         case 'w':
-            if (chdir(arg))
+            if (
+#ifdef WIN32
+              _chdir
+#else
+              chdir
+#endif
+                (arg)) 
             {
                 yaz_log(YLOG_FATAL|YLOG_ERRNO, "chdir %s", arg);
                 return 1;