repo.or.cz
/
unleashed.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge commit '008b34be09d7b9c3e7a18d3ce9ef8b5c4f4ff8b8'
[unleashed.git]
/
bin
/
pax
/
dprintf.c
blob
9364d3f992acc32ee13767d100dc67caf8db31fa
1
#include <stdio.h>
2
#include <stdarg.h>
3
#include <stdlib.h>
4
#include <unistd.h>
5
6
int
7
dprintf
(
int
fd
,
const char
*
fmt
, ...)
8
{
9
char
*
s
=
NULL
;
10
va_list
ap
;
11
int
ret
;
12
13
va_start
(
ap
,
fmt
);
14
ret
=
vasprintf
(&
s
,
fmt
,
ap
);
15
va_end
(
ap
);
16
if
(
ret
<
0
)
17
return
ret
;
18
ret
=
write
(
fd
,
s
,
ret
);
19
free
(
s
);
20
return
ret
;
21
}