Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_tlsv12/sys/src/cmd/unix/drawterm/libc/fmtfdflush.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <inttypes.h>
2
#include <u.h>
3
#include <libc.h>
4
#include "fmtdef.h"
5
 
6
/*
7
 * generic routine for flushing a formatting buffer
8
 * to a file descriptor
9
 */
10
int
11
__fmtFdFlush(Fmt *f)
12
{
13
	int n;
14
 
15
	n = (char*)f->to - (char*)f->start;
16
	if(n && write((uintptr_t)f->farg, f->start, n) != n)
17
		return 0;
18
	f->to = f->start;
19
	return 1;
20
}