diff --git a/ncat/ncat_core.c b/ncat/ncat_core.c index 8332c5b7c..006386f36 100644 --- a/ncat/ncat_core.c +++ b/ncat/ncat_core.c @@ -454,16 +454,6 @@ int ncat_delay_timer(int delayval) return 1; } -/* Open a logfile for writing. - * Return the open file descriptor. */ -int ncat_openlog(const char *logfile, int append) -{ - if (append) - return Open(logfile, O_BINARY | O_WRONLY | O_CREAT | O_APPEND, 0664); - else - return Open(logfile, O_BINARY | O_WRONLY | O_CREAT | O_TRUNC, 0664); -} - static int ncat_hexdump(int logfd, const char *data, int len); void ncat_log_send(const char *data, size_t len) diff --git a/ncat/ncat_posix.c b/ncat/ncat_posix.c index c83e4c9cf..9946b20b6 100644 --- a/ncat/ncat_posix.c +++ b/ncat/ncat_posix.c @@ -391,6 +391,14 @@ char **cmdline_split(const char *cmdexec) return cmd_args; } +int ncat_openlog(const char *logfile, int append) +{ + if (append) + return Open(logfile, O_WRONLY | O_CREAT | O_APPEND, 0664); + else + return Open(logfile, O_WRONLY | O_CREAT | O_TRUNC, 0664); +} + void set_lf_mode(void) { /* Nothing needed. */ diff --git a/ncat/ncat_win.c b/ncat/ncat_win.c index 7e6186ebf..d7ecce3a5 100644 --- a/ncat/ncat_win.c +++ b/ncat/ncat_win.c @@ -124,6 +124,14 @@ #include "nbase.h" #include "ncat.h" +int ncat_openlog(const char *logfile, int append) +{ + if (append) + return Open(logfile, O_BINARY | O_WRONLY | O_CREAT | O_APPEND, 0664); + else + return Open(logfile, O_BINARY | O_WRONLY | O_CREAT | O_TRUNC, 0664); +} + void set_lf_mode(void) { /* _O_TEXT (the default setting) converts \r\n to \n on input, making the