Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/sort add a description about what was being attempte...
details: https://anonhg.NetBSD.org/src/rev/354bf6f5c058
branches: trunk
changeset: 339713:354bf6f5c058
user: mrg <mrg%NetBSD.org@localhost>
date: Wed Aug 05 07:10:03 2015 +0000
description:
add a description about what was being attempted to failed writes messages.
diffstat:
usr.bin/sort/files.c | 13 ++++++++-----
usr.bin/sort/sort.h | 6 +++---
2 files changed, 11 insertions(+), 8 deletions(-)
diffs (69 lines):
diff -r 261cae0f58ff -r 354bf6f5c058 usr.bin/sort/files.c
--- a/usr.bin/sort/files.c Wed Aug 05 07:02:20 2015 +0000
+++ b/usr.bin/sort/files.c Wed Aug 05 07:10:03 2015 +0000
@@ -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.
@@ -64,7 +64,7 @@
#include "sort.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>
@@ -226,7 +226,8 @@
void
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 @@
void
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 @@
void
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");
}
/*
diff -r 261cae0f58ff -r 354bf6f5c058 usr.bin/sort/sort.h
--- a/usr.bin/sort/sort.h Wed Aug 05 07:02:20 2015 +0000
+++ b/usr.bin/sort/sort.h Wed Aug 05 07:10:03 2015 +0000
@@ -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.
@@ -100,9 +100,9 @@
err(2, "%p", file); \
}
-#define EWRITE(ptr, size, n, f) { \
+#define EWRITE(ptr, size, n, f, fmt) { \
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
Home |
Main Index |
Thread Index |
Old Index