1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00
putty-source/unix/utils/dputs.c

25 lines
449 B
C
Raw Normal View History

/*
* Implementation of dputs() for Unix.
*
* The debug messages are written to standard output, and also into a
* file called debug.log.
*/
#include <unistd.h>
#include "putty.h"
static FILE *debug_fp = NULL;
void dputs(const char *buf)
{
if (!debug_fp) {
debug_fp = fopen("debug.log", "w");
}
if (write(1, buf, strlen(buf)) < 0) {} /* 'error check' to placate gcc */
fputs(buf, debug_fp);
fflush(debug_fp);
}