equal
deleted
inserted
replaced
|
1 --- a/src/lib/libcmd/cmp.c Mon Apr 12 15:39:53 2010 |
|
2 +++ b/src/lib/libcmd/cmp.c Tue Jun 28 13:59:47 2011 |
|
3 @@ -1,3 +1,7 @@ |
|
4 +/* |
|
5 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
|
6 + */ |
|
7 + |
|
8 /*********************************************************************** |
|
9 * * |
|
10 * This software is part of the ast package * |
|
11 @@ -164,6 +168,10 @@ |
|
12 return ret; |
|
13 if (!(p1 = (unsigned char*)sfreserve(f1, SF_UNBOUND, 0)) || (c1 = sfvalue(f1)) <= 0) |
|
14 { |
|
15 + if (sferror(f1)) { |
|
16 + error(ERROR_exit(2), |
|
17 + "read error on %s", file1); |
|
18 + } |
|
19 if ((e2 - p2) > 0 || sfreserve(f2, SF_UNBOUND, 0) && sfvalue(f2) > 0) |
|
20 { |
|
21 ret = 1; |
|
22 @@ -170,6 +178,10 @@ |
|
23 if (!(flags & CMP_SILENT)) |
|
24 error(ERROR_exit(1), "EOF on %s", file1); |
|
25 } |
|
26 + if (sferror(f2)) { |
|
27 + error(ERROR_exit(2), |
|
28 + "read error on %s", file2); |
|
29 + } |
|
30 return ret; |
|
31 } |
|
32 if (count > 0 && c1 > count) |
|
33 @@ -181,6 +193,10 @@ |
|
34 { |
|
35 if (!(p2 = (unsigned char*)sfreserve(f2, SF_UNBOUND, 0)) || (c2 = sfvalue(f2)) <= 0) |
|
36 { |
|
37 + if (sferror(f2)) { |
|
38 + error(ERROR_exit(2), |
|
39 + "read error on %s", file2); |
|
40 + } |
|
41 if (!(flags & CMP_SILENT)) |
|
42 error(ERROR_exit(1), "EOF on %s", file2); |
|
43 return 1; |
|
44 |