Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144624703
D51592.1775850431.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D51592.1775850431.diff
View Options
diff --git a/usr.sbin/makefs/zfs/dsl.c b/usr.sbin/makefs/zfs/dsl.c
--- a/usr.sbin/makefs/zfs/dsl.c
+++ b/usr.sbin/makefs/zfs/dsl.c
@@ -119,7 +119,7 @@
if (nvlist_find_string(pdir->propsnv, "mountpoint",
&tmp) == 0) {
- easprintf(&mountpoint, "%s%s%s", tmp,
+ (void)easprintf(&mountpoint, "%s%s%s", tmp,
tmp[strlen(tmp) - 1] == '/' ? "" : "/",
origmountpoint);
free(tmp);
@@ -127,7 +127,7 @@
break;
}
- easprintf(&mountpoint, "%s/%s", pdir->name,
+ (void)easprintf(&mountpoint, "%s/%s", pdir->name,
origmountpoint);
free(origmountpoint);
}
@@ -175,22 +175,22 @@
"the root path `%s'", val, zfs->rootpath);
}
}
- nvlist_add_string(nvl, key, val);
+ (void)nvlist_add_string(nvl, key, val);
} else if (strcmp(key, "atime") == 0 || strcmp(key, "exec") == 0 ||
strcmp(key, "setuid") == 0) {
if (strcmp(val, "on") == 0)
- nvlist_add_uint64(nvl, key, 1);
+ (void)nvlist_add_uint64(nvl, key, 1);
else if (strcmp(val, "off") == 0)
- nvlist_add_uint64(nvl, key, 0);
+ (void)nvlist_add_uint64(nvl, key, 0);
else
errx(1, "invalid value `%s' for %s", val, key);
} else if (strcmp(key, "canmount") == 0) {
if (strcmp(val, "noauto") == 0)
- nvlist_add_uint64(nvl, key, 2);
+ (void)nvlist_add_uint64(nvl, key, 2);
else if (strcmp(val, "on") == 0)
- nvlist_add_uint64(nvl, key, 1);
+ (void)nvlist_add_uint64(nvl, key, 1);
else if (strcmp(val, "off") == 0)
- nvlist_add_uint64(nvl, key, 0);
+ (void)nvlist_add_uint64(nvl, key, 0);
else
errx(1, "invalid value `%s' for %s", val, key);
} else if (strcmp(key, "compression") == 0) {
@@ -237,7 +237,7 @@
zfs_dsl_dir_t *dir;
char *path;
- easprintf(&path, "%s/%s", zfs->poolname, name);
+ (void)easprintf(&path, "%s/%s", zfs->poolname, name);
dir = dsl_dir_alloc(zfs, path);
free(path);
return (dir);
@@ -322,11 +322,11 @@
* user didn't override the defaults.
*/
if (nvpair_find(zfs->rootdsldir->propsnv, "compression") == NULL) {
- nvlist_add_uint64(zfs->rootdsldir->propsnv, "compression",
- ZIO_COMPRESS_OFF);
+ (void)nvlist_add_uint64(zfs->rootdsldir->propsnv,
+ "compression", ZIO_COMPRESS_OFF);
}
if (nvpair_find(zfs->rootdsldir->propsnv, "mountpoint") == NULL) {
- nvlist_add_string(zfs->rootdsldir->propsnv, "mountpoint",
+ (void)nvlist_add_string(zfs->rootdsldir->propsnv, "mountpoint",
zfs->rootpath);
}
}
@@ -431,6 +431,7 @@
STAILQ_INIT(&l);
STAILQ_INSERT_HEAD(&l, zfs->rootdsldir, next);
origname = dirname = nextdir = estrdup(name);
+ parent = NULL;
for (lp = &l;; lp = &parent->children) {
dirname = strsep(&nextdir, "/");
if (nextdir == NULL)
diff --git a/usr.sbin/makefs/zfs/fs.c b/usr.sbin/makefs/zfs/fs.c
--- a/usr.sbin/makefs/zfs/fs.c
+++ b/usr.sbin/makefs/zfs/fs.c
@@ -28,6 +28,7 @@
* SUCH DAMAGE.
*/
+#include <sys/param.h>
#include <sys/stat.h>
#include <assert.h>
@@ -734,7 +735,7 @@
assert(sizeof(layout[0]) == 2);
- snprintf(ti, sizeof(ti), "%u", index);
+ (void)snprintf(ti, sizeof(ti), "%u", index);
zap_add(zap, ti, sizeof(sa_attr_type_t), sacnt,
(const uint8_t *)layout);
}
diff --git a/usr.sbin/makefs/zfs/objset.c b/usr.sbin/makefs/zfs/objset.c
--- a/usr.sbin/makefs/zfs/objset.c
+++ b/usr.sbin/makefs/zfs/objset.c
@@ -28,6 +28,7 @@
* SUCH DAMAGE.
*/
+#include <sys/param.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.sbin/makefs/zfs/vdev.c b/usr.sbin/makefs/zfs/vdev.c
--- a/usr.sbin/makefs/zfs/vdev.c
+++ b/usr.sbin/makefs/zfs/vdev.c
@@ -28,6 +28,7 @@
* SUCH DAMAGE.
*/
+#include <sys/param.h>
#include <assert.h>
#include <fcntl.h>
#include <stdlib.h>
diff --git a/usr.sbin/makefs/zfs/zap.c b/usr.sbin/makefs/zfs/zap.c
--- a/usr.sbin/makefs/zfs/zap.c
+++ b/usr.sbin/makefs/zfs/zap.c
@@ -28,7 +28,7 @@
* SUCH DAMAGE.
*/
-#include <sys/types.h>
+#include <sys/param.h>
#include <sys/endian.h>
#include <assert.h>
@@ -172,14 +172,14 @@
{
char name[32];
- snprintf(name, sizeof(name), "%jx", (uintmax_t)val);
+ (void)snprintf(name, sizeof(name), "%jx", (uintmax_t)val);
zap_add(zap, name, sizeof(uint64_t), 1, (uint8_t *)&val);
}
void
zap_add_string(zfs_zap_t *zap, const char *name, const char *val)
{
- zap_add(zap, name, 1, strlen(val) + 1, val);
+ zap_add(zap, name, 1, strlen(val) + 1, (const uint8_t *)val);
}
bool
@@ -221,7 +221,8 @@
STAILQ_FOREACH(ent, &zap->kvps, next) {
memcpy(&ment->mze_value, ent->valp, ent->intsz * ent->intcnt);
ment->mze_cd = cd++;
- strlcpy(ment->mze_name, ent->name, sizeof(ment->mze_name));
+ (void)strlcpy(ment->mze_name, ent->name,
+ sizeof(ment->mze_name));
ment++;
}
@@ -247,6 +248,7 @@
struct zap_leaf_array *la;
assert(sz <= ZAP_MAXVALUELEN);
+ assert(sz > 0);
for (uint16_t n, resid = sz; resid > 0; resid -= n, val += n, li++) {
n = MIN(resid, ZAP_LEAF_ARRAY_BYTES);
@@ -503,7 +505,8 @@
le->le_value_intlen = ent->intsz;
le->le_value_numints = ent->intcnt;
le->le_hash = ent->hash;
- zap_fat_write_array_chunk(&l, *lptr + 1, namelen, ent->name);
+ zap_fat_write_array_chunk(&l, *lptr + 1, namelen,
+ (uint8_t *)ent->name);
zap_fat_write_array_chunk(&l, *lptr + 1 + nnamechunks,
ent->intcnt * ent->intsz, ent->valp);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 10, 7:47 PM (12 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28319029
Default Alt Text
D51592.1775850431.diff (5 KB)
Attached To
Mode
D51592: makefs: clean up warnings
Attached
Detach File
Event Timeline
Log In to Comment