Changeset a42d7d8 in mainline for uspace/lib/bithenge/blob.c
- Timestamp:
- 2012-08-19T05:28:24Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fae4d30
- Parents:
- 1c79996
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/bithenge/blob.c
r1c79996 ra42d7d8 461 461 /** Check whether the contents of two blobs are equal. 462 462 * @memberof bithenge_blob_t 463 * @param[out] out Holds whether the blobs are equal. 463 464 * @param a, b Blobs to compare. 464 * @return Whether the blobs are equal. If an error occurs, returns false.465 */ 466 bool bithenge_blob_equal(bithenge_blob_t *a, bithenge_blob_t *b)465 * @return EOK on success, or an error code from errno.h. 466 */ 467 int bithenge_blob_equal(bool *out, bithenge_blob_t *a, bithenge_blob_t *b) 467 468 { 468 469 assert(a); … … 476 477 rc = bithenge_blob_read(a, offset, buffer_a, &size_a); 477 478 if (rc != EOK) 478 return false;479 return rc; 479 480 rc = bithenge_blob_read(b, offset, buffer_b, &size_b); 480 481 if (rc != EOK) 481 return false; 482 if (size_a != size_b || bcmp(buffer_a, buffer_b, size_a)) 483 return false; 482 return rc; 483 if (size_a != size_b || bcmp(buffer_a, buffer_b, size_a)) { 484 *out = false; 485 return EOK; 486 } 484 487 offset += size_a; 485 488 } while (size_a == sizeof(buffer_a)); 486 return true; 489 *out = true; 490 return EOK; 487 491 } 488 492
Note:
See TracChangeset
for help on using the changeset viewer.