Remove bcopy(), bzero(), bcmp()

bcopy() has a confusing argument order and is actually a move, not a
copy; they're all deprecated since POSIX.1-2001 and removed in -2008,
and we shim them out to mem*() on Linux anyway

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12996
This commit is contained in:
наб
2022-02-25 14:26:54 +01:00
committed by Brian Behlendorf
parent 1d77d62f5a
commit 861166b027
129 changed files with 990 additions and 1051 deletions
+1 -1
View File
@@ -788,7 +788,7 @@ derive_key(libzfs_handle_t *hdl, zfs_keyformat_t format, uint64_t iters,
switch (format) {
case ZFS_KEYFORMAT_RAW:
bcopy(key_material, key, WRAPPING_KEY_LEN);
memcpy(key, key_material, WRAPPING_KEY_LEN);
break;
case ZFS_KEYFORMAT_HEX:
ret = hex_key_to_raw((char *)key_material,
+1 -2
View File
@@ -3931,14 +3931,13 @@ zpool_vdev_remove(zpool_handle_t *zhp, const char *path)
int
zpool_vdev_remove_cancel(zpool_handle_t *zhp)
{
zfs_cmd_t zc;
zfs_cmd_t zc = {{0}};
char msg[1024];
libzfs_handle_t *hdl = zhp->zpool_hdl;
(void) snprintf(msg, sizeof (msg),
dgettext(TEXT_DOMAIN, "cannot cancel removal"));
bzero(&zc, sizeof (zc));
(void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
zc.zc_cookie = 1;
+3 -5
View File
@@ -4285,9 +4285,9 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
boolean_t recursive;
char *snapname = NULL;
char destsnap[MAXPATHLEN * 2];
char origin[MAXNAMELEN];
char origin[MAXNAMELEN] = {0};
char name[MAXPATHLEN];
char tmp_keylocation[MAXNAMELEN];
char tmp_keylocation[MAXNAMELEN] = {0};
nvlist_t *rcvprops = NULL; /* props received from the send stream */
nvlist_t *oxprops = NULL; /* override (-o) and exclude (-x) props */
nvlist_t *origprops = NULL; /* original props (if destination exists) */
@@ -4303,8 +4303,6 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
#endif
clock_gettime(CLOCK_MONOTONIC_RAW, &begin_time);
bzero(origin, MAXNAMELEN);
bzero(tmp_keylocation, MAXNAMELEN);
(void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
"cannot receive"));
@@ -5228,7 +5226,7 @@ zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap,
* We computed the checksum in the wrong byteorder in
* recv_read() above; do it again correctly.
*/
bzero(&zcksum, sizeof (zio_cksum_t));
memset(&zcksum, 0, sizeof (zio_cksum_t));
fletcher_4_incremental_byteswap(&drr, sizeof (drr), &zcksum);
flags->byteswap = B_TRUE;
+1 -1
View File
@@ -807,7 +807,7 @@ zfs_realloc(libzfs_handle_t *hdl, void *ptr, size_t oldsize, size_t newsize)
return (NULL);
}
bzero((char *)ret + oldsize, (newsize - oldsize));
memset((char *)ret + oldsize, 0, newsize - oldsize);
return (ret);
}
+3 -3
View File
@@ -103,9 +103,9 @@ execvPe(const char *name, const char *path, char * const *argv,
16);
continue;
}
bcopy(p, buf, lp);
memcpy(buf, p, lp);
buf[lp] = '/';
bcopy(name, buf + lp + 1, ln);
memcpy(buf + lp + 1, name, ln);
buf[lp + ln + 1] = '\0';
retry: (void) execve(bp, argv, envp);
@@ -135,7 +135,7 @@ retry: (void) execve(bp, argv, envp);
if (cnt > 0) {
memp[0] = argv[0];
memp[1] = bp;
bcopy(argv + 1, memp + 2,
memcpy(memp + 2, argv + 1,
cnt * sizeof (char *));
} else {
memp[0] = "sh";