Coverage Report

Created: 2025-12-10 06:45

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/plan9port/src/lib9/fmt/fmtfdflush.c
Line
Count
Source
1
/* Copyright (c) 2002-2006 Lucent Technologies; see LICENSE */
2
#include <stdarg.h>
3
#include <unistd.h>
4
#include "plan9.h"
5
#include "fmt.h"
6
#include "fmtdef.h"
7
8
/*
9
 * generic routine for flushing a formatting buffer
10
 * to a file descriptor
11
 */
12
int
13
__fmtFdFlush(Fmt *f)
14
41.2k
{
15
41.2k
  int n;
16
17
41.2k
  n = (char*)f->to - (char*)f->start;
18
41.2k
  if(n && write((uintptr)f->farg, f->start, n) != n)
19
0
    return 0;
20
41.2k
  f->to = f->start;
21
41.2k
  return 1;
22
41.2k
}