diff options
author | Karel Zak | 2012-12-20 19:55:20 +0100 |
---|---|---|
committer | Karel Zak | 2012-12-20 19:55:20 +0100 |
commit | 747c1d9d57130aab172a3e284d84c99463392758 (patch) | |
tree | 89ff05160126d24e57251a2172520453d3779548 /term-utils | |
parent | ipcs: fix compiler warnings, use 64bit time (diff) | |
download | kernel-qcow2-util-linux-747c1d9d57130aab172a3e284d84c99463392758.tar.gz kernel-qcow2-util-linux-747c1d9d57130aab172a3e284d84c99463392758.tar.xz kernel-qcow2-util-linux-747c1d9d57130aab172a3e284d84c99463392758.zip |
setterm: fix compiler warning
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils')
-rw-r--r-- | term-utils/setterm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/term-utils/setterm.c b/term-utils/setterm.c index 18873f331..1cbc97900 100644 --- a/term-utils/setterm.c +++ b/term-utils/setterm.c @@ -1159,6 +1159,7 @@ screendump(int vcnum, FILE * F) unsigned int rows, cols; int fd; size_t i, j; + ssize_t rc; char *inbuf, *outbuf, *p, *q; sprintf(infile, "/dev/vcsa%d", vcnum); @@ -1188,7 +1189,8 @@ screendump(int vcnum, FILE * F) inbuf = xmalloc(rows * cols * 2); outbuf = xmalloc(rows * (cols + 1)); - if (read(fd, inbuf, rows * cols * 2) != rows * cols * 2) + rc = read(fd, inbuf, rows * cols * 2); + if (rc < 0 || (size_t) rc != rows * cols * 2) goto read_error; p = inbuf; q = outbuf; |