add a description about what was being attempted to failed writes messages.
This commit is contained in:
parent
b8ce913648
commit
366296f5a8
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: files.c,v 1.41 2009/11/06 18:34:22 joerg Exp $ */
|
/* $NetBSD: files.c,v 1.42 2015/08/05 07:10:03 mrg Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
|
* Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
#include "sort.h"
|
#include "sort.h"
|
||||||
#include "fsort.h"
|
#include "fsort.h"
|
||||||
|
|
||||||
__RCSID("$NetBSD: files.c,v 1.41 2009/11/06 18:34:22 joerg Exp $");
|
__RCSID("$NetBSD: files.c,v 1.42 2015/08/05 07:10:03 mrg Exp $");
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -226,7 +226,8 @@ seq(FILE *fp, u_char **line)
|
||||||
void
|
void
|
||||||
putrec(const RECHEADER *rec, FILE *fp)
|
putrec(const RECHEADER *rec, FILE *fp)
|
||||||
{
|
{
|
||||||
EWRITE(rec, 1, REC_ROUNDUP(offsetof(RECHEADER, data) + rec->length), fp);
|
EWRITE(rec, 1, REC_ROUNDUP(offsetof(RECHEADER, data) + rec->length), fp,
|
||||||
|
"failed to write temp file");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -235,7 +236,8 @@ putrec(const RECHEADER *rec, FILE *fp)
|
||||||
void
|
void
|
||||||
putline(const RECHEADER *rec, FILE *fp)
|
putline(const RECHEADER *rec, FILE *fp)
|
||||||
{
|
{
|
||||||
EWRITE(rec->data+rec->offset, 1, rec->length - rec->offset, fp);
|
EWRITE(rec->data+rec->offset, 1, rec->length - rec->offset, fp,
|
||||||
|
"failed to write");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -244,7 +246,8 @@ putline(const RECHEADER *rec, FILE *fp)
|
||||||
void
|
void
|
||||||
putkeydump(const RECHEADER *rec, FILE *fp)
|
putkeydump(const RECHEADER *rec, FILE *fp)
|
||||||
{
|
{
|
||||||
EWRITE(rec, 1, REC_ROUNDUP(offsetof(RECHEADER, data) + rec->offset), fp);
|
EWRITE(rec, 1, REC_ROUNDUP(offsetof(RECHEADER, data) + rec->offset), fp,
|
||||||
|
"failed to write debug key");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: sort.h,v 1.34 2011/09/16 15:39:29 joerg Exp $ */
|
/* $NetBSD: sort.h,v 1.35 2015/08/05 07:10:03 mrg Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
|
* Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
|
||||||
|
@ -100,9 +100,9 @@
|
||||||
err(2, "%p", file); \
|
err(2, "%p", file); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define EWRITE(ptr, size, n, f) { \
|
#define EWRITE(ptr, size, n, f, fmt) { \
|
||||||
if (!fwrite(ptr, size, n, f)) \
|
if (!fwrite(ptr, size, n, f)) \
|
||||||
err(2, NULL); \
|
err(2, fmt); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Records are limited to MAXBUFSIZE (8MB) and less if you want to sort
|
/* Records are limited to MAXBUFSIZE (8MB) and less if you want to sort
|
||||||
|
|
Loading…
Reference in New Issue