Forbid b{copy,zero,cmp}(). Don't include <strings.h> for <string.h>

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12996
This commit is contained in:
наб
2022-01-22 01:56:46 +01:00
committed by Brian Behlendorf
parent 861166b027
commit d465fc5844
61 changed files with 63 additions and 141 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ extern "C" {
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <strings.h>
#include <string.h>
#define BLOCKSZ 8192
#define DATA 0xa5
@@ -20,7 +20,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <libzfs_core.h>
#include <libzutil.h>
@@ -33,19 +32,19 @@
* Test the nvpair inputs for the non-legacy zfs ioctl commands.
*/
boolean_t unexpected_failures;
int zfs_fd;
const char *active_test;
static boolean_t unexpected_failures;
static int zfs_fd;
static const char *active_test;
/*
* Tracks which zfs_ioc_t commands were tested
*/
boolean_t ioc_tested[ZFS_IOC_LAST - ZFS_IOC_FIRST];
static boolean_t ioc_tested[ZFS_IOC_LAST - ZFS_IOC_FIRST];
/*
* Legacy ioctls that are skipped (for now)
*/
static unsigned ioc_skip[] = {
static const zfs_ioc_t ioc_skip[] = {
ZFS_IOC_POOL_CREATE,
ZFS_IOC_POOL_DESTROY,
ZFS_IOC_POOL_IMPORT,
+1 -1
View File
@@ -24,7 +24,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#include <strings.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
@@ -20,13 +20,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <libzfs_core.h>
#include <sys/nvpair.h>
nvlist_t *nvl;
const char *pool;
boolean_t unexpected_failures;
static nvlist_t *nvl;
static const char *pool;
static boolean_t unexpected_failures;
static boolean_t
nvlist_equal(nvlist_t *nvla, nvlist_t *nvlb)
+6 -9
View File
@@ -46,7 +46,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <strings.h>
int
main(void)
@@ -58,6 +57,7 @@ main(void)
perror("fork");
exit(1);
break;
case 0:
while (i > 0) {
int c_count = 0;
@@ -65,11 +65,11 @@ main(void)
c_count++;
if (rename("1/2/3/c", "a/b/c") == 0)
c_count++;
if (c_count) {
if (c_count)
(void) fprintf(stderr, "c_count: %d", c_count);
}
}
break;
_exit(0);
default:
while (i > 0) {
int p_count = 0;
@@ -77,12 +77,9 @@ main(void)
p_count++;
if (rename("a/b/c/d/e/1", "1") == 0)
p_count++;
if (p_count) {
if (p_count)
(void) fprintf(stderr, "p_count: %d", p_count);
}
}
break;
return (0);
}
return (0);
}
@@ -45,7 +45,6 @@
#include <sys/stat.h>
#include <stdlib.h>
#include <unistd.h>
#include <strings.h>
static char *filebase;
@@ -34,7 +34,7 @@
#include <sys/skein.h>
#include <stdlib.h>
#include <strings.h>
#include <string.h>
#include <stdio.h>
#include <sys/time.h>
#include <sys/stdtypes.h>
@@ -38,7 +38,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <strings.h>
#include <errno.h>
#include <fcntl.h>
#include <libgen.h>
@@ -18,13 +18,11 @@
*/
#include <stdio.h>
#include <strings.h>
#include <string.h>
#include <sys/crypto/icp.h>
#include <sys/sha2.h>
#include <sys/hkdf.h>
#define NELEMS(x) (sizeof (x) / sizeof ((x)[0]))
/*
* Byte arrays are given as char pointers so that they
* can be specified as strings.
@@ -214,7 +212,7 @@ main(void)
icp_init();
for (i = 0; i < NELEMS(test_vectors); i++) {
for (i = 0; i < ARRAY_SIZE(test_vectors); i++) {
ret = run_test(i, &test_vectors[i]);
if (ret != 0)
break;