fsx: Replace use of bzero() with memset()
authorTheodore Ts'o <tytso@mit.edu>
Wed, 13 May 2009 18:31:46 +0000 (13:31 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 13 May 2009 18:31:46 +0000 (13:31 -0500)
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" <tytso@mit.edu>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
ltp/fsx.c

index 0bd5d919409917036f756c2336cb2a5074631c68..fb15064a556faadab985d9bb48fb363165b8473d 100644 (file)
--- 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;