xfs-masters
[Top] [All Lists]

[PATCH 3/6] fsx: Replace use of bzero() with memset()

To: xfs-masters@xxxxxxxxxxx
Subject: [PATCH 3/6] fsx: Replace use of bzero() with memset()
From: "Theodore Ts'o" <tytso@xxxxxxx>
Date: Tue, 12 May 2009 12:14:22 -0400
Cc: "Theodore Ts'o" <tytso@xxxxxxx>
In-reply-to: <1242144865-6967-2-git-send-email-tytso@xxxxxxx>
References: <1242144865-6967-1-git-send-email-tytso@xxxxxxx> <1242144865-6967-2-git-send-email-tytso@xxxxxxx>
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@xxxxxxx>
---
 ltp/fsx.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ltp/fsx.c b/ltp/fsx.c
index b2b17cd..2574165 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)
@@ -1245,10 +1245,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;
 
-- 
1.6.3.rc4.1.g3e14.dirty

<Prev in Thread] Current Thread [Next in Thread>