Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/rump_allserver * at least try to query size of non-r...
details: https://anonhg.NetBSD.org/src/rev/f8fdd292df44
branches: trunk
changeset: 762532:f8fdd292df44
user: pooka <pooka%NetBSD.org@localhost>
date: Tue Feb 22 15:51:59 2011 +0000
description:
* at least try to query size of non-regular size=host files too,
give up if we get 0
* fix a few error messages
diffstat:
usr.bin/rump_allserver/rump_allserver.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diffs (48 lines):
diff -r 096f56e91e61 -r f8fdd292df44 usr.bin/rump_allserver/rump_allserver.c
--- a/usr.bin/rump_allserver/rump_allserver.c Tue Feb 22 15:47:02 2011 +0000
+++ b/usr.bin/rump_allserver/rump_allserver.c Tue Feb 22 15:51:59 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rump_allserver.c,v 1.20 2011/02/21 18:50:21 pooka Exp $ */
+/* $NetBSD: rump_allserver.c,v 1.21 2011/02/22 15:51:59 pooka Exp $ */
/*-
* Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved.
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: rump_allserver.c,v 1.20 2011/02/21 18:50:21 pooka Exp $");
+__RCSID("$NetBSD: rump_allserver.c,v 1.21 2011/02/22 15:51:59 pooka Exp $");
#endif /* !lint */
#include <sys/types.h>
@@ -180,7 +180,7 @@
fprintf(stderr,
"cannot specify "
"offset with "
- "size=e\n");
+ "size=host\n");
usage();
}
flen = DSIZE_E;
@@ -199,7 +199,7 @@
if (flen == DSIZE_E) {
fprintf(stderr, "cannot "
"specify offset with "
- "size=e\n");
+ "size=host\n");
usage();
}
/* XXX: off_t max? */
@@ -383,8 +383,9 @@
if (fstat(fd, &sb) == -1)
die(sflag, errno, "fstat etfs hostpath");
if (flen == DSIZE_E) {
- if (!S_ISREG(sb.st_mode))
- die(sflag, EINVAL, "size=e requires reg file");
+ if (sb.st_size == 0)
+ die(sflag, EINVAL, "size=host, but cannot "
+ "query non-zero size");
flen = sb.st_size;
}
fendoff = foffset + flen;
Home |
Main Index |
Thread Index |
Old Index