tests/libcurses: simplify code for writing to the .exp file
If a write(2) returns less than 1, it must be an error.
This commit is contained in:
parent
bdb9e6b7f3
commit
58e6134faa
|
@ -1,5 +1,5 @@
|
|||
%{
|
||||
/* $NetBSD: testlang_parse.y,v 1.28 2021/02/07 17:50:16 rillig Exp $ */
|
||||
/* $NetBSD: testlang_parse.y,v 1.29 2021/02/07 18:14:43 rillig Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright 2009 Brett Lymn <blymn@NetBSD.org>
|
||||
|
@ -1092,13 +1092,8 @@ compare_streams(char *filename, bool discard)
|
|||
}
|
||||
|
||||
if (create_check_file) {
|
||||
if ((result = write(check_fd, &data, 1)) < 1) {
|
||||
if (result != 0) {
|
||||
err(2,
|
||||
"Bad write on file %s", check_file);
|
||||
}
|
||||
}
|
||||
else
|
||||
if ((result = write(check_fd, &data, 1)) < 1)
|
||||
err(2, "Bad write on file %s", check_file);
|
||||
ref = data;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue