summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1f65167)
that we'll terminate promptly in cases of (for instance) a disk
filling up.
git-svn-id: svn://svn.tartarus.org/sgt/agedu@8744
cda61777-01e9-0310-a592-
d414129be87e
static void dump_line(const char *pathname, const struct trie_file *tf)
{
const char *p;
static void dump_line(const char *pathname, const struct trie_file *tf)
{
const char *p;
- printf("%llu %llu ", tf->size, tf->atime);
+ if (printf("%llu %llu ", tf->size, tf->atime) < 0) goto error;
for (p = pathname; *p; p++) {
for (p = pathname; *p; p++) {
- if (*p >= ' ' && *p < 127 && *p != '%')
- putchar(*p);
- else
- printf("%%%02x", (unsigned char)*p);
+ if (*p >= ' ' && *p < 127 && *p != '%') {
+ if (putchar(*p) == EOF) goto error;
+ } else {
+ if (printf("%%%02x", (unsigned char)*p) < 0) goto error;
+ }
+ if (putchar('\n') == EOF) goto error;
+ return;
+ error:
+ fatal("standard output: %s", strerror(errno));
}
static int gotdata(void *vctx, const char *pathname, const STRUCT_STAT *st)
}
static int gotdata(void *vctx, const char *pathname, const STRUCT_STAT *st)