From 7c98d81dafd9b8bc8745d897603a424aee328c1c Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sun, 17 Jan 2016 20:15:31 -0500 Subject: rewrite message-passing, no signals needed! --- src/util.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index 6d2d184..99a70c5 100644 --- a/src/util.c +++ b/src/util.c @@ -33,18 +33,8 @@ void debugf_real(const char *func, int line, const char *file, const char *fmt, (void) func; (void) line; (void) file; - static int fd = -1; - if(fd < 0) - fd = open(LOGFILE, O_APPEND | O_WRONLY | O_CREAT, 0600); - if(fd < 0) - error("unknown"); + int len; -#if 0 - char *prefix; - len = asprintf(&prefix, "%s:%s:%d: ", func, file, line); - write(STDOUT_FILENO, prefix, len); - free(prefix); -#endif va_list ap; va_start(ap, fmt); @@ -53,8 +43,6 @@ void debugf_real(const char *func, int line, const char *file, const char *fmt, len = vasprintf(&buf, fmt, ap); write(STDOUT_FILENO, buf, len); - write(fd, buf, len); - fflush(fdopen(fd, "a")); free(buf); -- cgit v1.1