MCPcopy Create free account
hub / github.com/F-Stack/f-stack / nvpair_move_string

Function nvpair_move_string

freebsd/contrib/libnv/bsd_nvpair.c:1539–1558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1537#endif
1538
1539nvpair_t *
1540nvpair_move_string(const char *name, char *value)
1541{
1542 nvpair_t *nvp;
1543
1544 if (value == NULL) {
1545 ERRNO_SET(EINVAL);
1546 return (NULL);
1547 }
1548
1549 nvp = nvpair_allocv(name, NV_TYPE_STRING, (uint64_t)(uintptr_t)value,
1550 strlen(value) + 1, 0);
1551 if (nvp == NULL) {
1552 ERRNO_SAVE();
1553 nv_free(value);
1554 ERRNO_RESTORE();
1555 }
1556
1557 return (nvp);
1558}
1559
1560nvpair_t *
1561nvpair_move_nvlist(const char *name, nvlist_t *value)

Callers 1

nvlist_move_stringFunction · 0.85

Calls 1

nvpair_allocvFunction · 0.85

Tested by

no test coverage detected