Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/regress/sys/kern/kqueue/read/file fix the -n handling code
details: https://anonhg.NetBSD.org/src/rev/2fc77e9aa765
branches: trunk
changeset: 538111:2fc77e9aa765
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Sat Oct 12 11:15:08 2002 +0000
description:
fix the -n handling code
diffstat:
regress/sys/kern/kqueue/read/file/file.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (32 lines):
diff -r bca7b254759f -r 2fc77e9aa765 regress/sys/kern/kqueue/read/file/file.c
--- a/regress/sys/kern/kqueue/read/file/file.c Sat Oct 12 10:46:24 2002 +0000
+++ b/regress/sys/kern/kqueue/read/file/file.c Sat Oct 12 11:15:08 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: file.c,v 1.1.1.1 2002/10/03 07:46:03 jdolecek Exp $ */
+/* $NetBSD: file.c,v 1.2 2002/10/12 11:15:08 jdolecek Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -62,10 +62,11 @@
}
if (argc == 4) {
- if (strcmp(argv[2], "-n") == 0)
- n = atoi(argv[3]);
+ if (strcmp(argv[1], "-n") == 0)
+ num = atoi(argv[2]);
else
goto usg;
+ argv += 2;
}
fd = open(argv[1], O_RDONLY|O_CREAT, 0644);
@@ -103,7 +104,7 @@
n = read(fd, buffer, 128);
buffer[n] = '\0';
- printf("%s", buffer);
+ printf("file(%d): %s", num, buffer);
}
printf("read: successful end\n");
Home |
Main Index |
Thread Index |
Old Index