Introduction
Introduction Statistics Contact Development Disclaimer Help
Use vdprintf() instead of the dup dup. - geomyidae - A small C-based gopherd.
git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfri…
Log
Files
Refs
Tags
README
LICENSE
---
commit 93c55f39d5bd322b6dc9bf13fb2025264dc52341
parent c98811c741255305b3fbff36a7b06bfb263d3ebc
Author: Christoph Lohmann <[email protected]>
Date: Sun, 11 Jun 2017 19:24:16 +0200
Use vdprintf() instead of the dup dup.
Diffstat:
M ind.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
---
diff --git a/ind.c b/ind.c
@@ -281,22 +281,11 @@ void
tprintf(int fd, char *fmt, ...)
{
va_list fmtargs;
- int fd2;
- FILE *fp;
-
- fd2 = dup(fd);
- fp = fdopen(fd2, "w");
- if(fp == nil) {
- perror("fdopen");
- return;
- }
va_start(fmtargs, fmt);
- vfprintf(fp, fmt, fmtargs);
+ vdprintf(fd, fmt, fmtargs);
va_end(fmtargs);
- fclose(fp);
-
return;
}
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.