From 59040620b4dab477c924c56cfaeead21682c1fec Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Wed, 13 May 2009 13:31:46 -0500 Subject: [PATCH] fsx: Replace use of bzero() with memset() The bzero() function comes from BSD 4.3, and was deprecated in POSIX.1-2001. It was removed entirely in POSIX.1-2008. Signed-off-by: "Theodore Ts'o" Signed-off-by: Eric Sandeen --- ltp/fsx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ltp/fsx.c b/ltp/fsx.c index 0bd5d919..fb15064a 100644 --- a/ltp/fsx.c +++ b/ltp/fsx.c @@ -589,7 +589,7 @@ dowrite(unsigned offset, unsigned size) gendata(original_buf, good_buf, offset, size); if (file_size < offset + size) { if (file_size < offset) - bzero(good_buf + file_size, offset - file_size); + memset(good_buf + file_size, '\0', offset - file_size); file_size = offset + size; if (lite) { warn("Lite file size bug in fsx!"); @@ -656,7 +656,7 @@ domapwrite(unsigned offset, unsigned size) gendata(original_buf, good_buf, offset, size); if (file_size < offset + size) { if (file_size < offset) - bzero(good_buf + file_size, offset - file_size); + memset(good_buf + file_size, '\0', offset - file_size); file_size = offset + size; if (lite) { warn("Lite file size bug in fsx!"); @@ -718,7 +718,7 @@ dotruncate(unsigned size) log4(OP_TRUNCATE, size, (unsigned)file_size, 0); if (size > file_size) - bzero(good_buf + file_size, size - file_size); + memset(good_buf + file_size, '\0', size - file_size); file_size = size; if (testcalls <= simulatedopcount) @@ -1274,10 +1274,10 @@ main(int argc, char **argv) original_buf[i] = random() % 256; good_buf = (char *) malloc(maxfilelen + writebdy); good_buf = round_up(good_buf, writebdy, 0); - bzero(good_buf, maxfilelen); + memset(good_buf, '\0', maxfilelen); temp_buf = (char *) malloc(maxoplen + readbdy); temp_buf = round_up(temp_buf, readbdy, 0); - bzero(temp_buf, maxoplen); + memset(temp_buf, '\0', maxoplen); if (lite) { /* zero entire existing file */ ssize_t written; -- 2.47.3