The text pattern (the default) could not be selected. Fixed now.

This commit is contained in:
marco 2007-02-08 22:35:12 +00:00
parent 1b80b0a153
commit 17bcf0ee3e
2 changed files with 7 additions and 5 deletions

View File

@ -1,7 +1,7 @@
# $OpenBSD: Makefile,v 1.13 2007/02/07 14:43:03 marco Exp $ # $OpenBSD: Makefile,v 1.14 2007/02/08 22:35:12 marco Exp $
COMMENT= "i/o generator" COMMENT= "i/o generator"
PKGNAME= iogen-2.1 PKGNAME= iogen-2.2
CATEGORIES= sysutils CATEGORIES= sysutils
DISTFILES= DISTFILES=

View File

@ -1,4 +1,4 @@
/* $OpenBSD: iogen.c,v 1.5 2007/02/07 14:43:03 marco Exp $ */ /* $OpenBSD: iogen.c,v 1.6 2007/02/08 22:35:12 marco Exp $ */
/* /*
* Copyright (c) 2005 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2005 Marco Peereboom <marco@peereboom.us>
* *
@ -127,7 +127,6 @@ killall(void)
int int
get_pattern(int pat, struct iog_pattern *ip) get_pattern(int pat, struct iog_pattern *ip)
{ {
u_int64_t pa = IOGEN_PAT_TEXT;
u_int64_t scratch[MAX_PAT_SIZE / sizeof(u_int64_t)]; u_int64_t scratch[MAX_PAT_SIZE / sizeof(u_int64_t)];
u_int32_t s = 0; u_int32_t s = 0;
u_int8_t *p; u_int8_t *p;
@ -255,6 +254,9 @@ get_pattern(int pat, struct iog_pattern *ip)
*p++ = x; *p++ = x;
ip->size = x; ip->size = x;
break; break;
case IOGEN_PAT_TEXT:
ip->pattern = pat;
return (0);
default: default:
return (1); return (1);
} }
@ -702,7 +704,7 @@ main(int argc, char *argv[])
} }
pattern = atoi(optarg); pattern = atoi(optarg);
if (pattern >= IOGEN_PAT_TEXT) if (pattern > IOGEN_PAT_TEXT)
errx(1, "illegal pattern"); errx(1, "illegal pattern");
break; break;
case 'h': case 'h':