Module Name: src Committed By: christos Date: Tue May 4 17:51:55 UTC 2021
Modified Files: src/share/man/man4: envsys.4 Log Message: Fix code example (from RVP) To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/share/man/man4/envsys.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/man/man4/envsys.4 diff -u src/share/man/man4/envsys.4:1.54 src/share/man/man4/envsys.4:1.55 --- src/share/man/man4/envsys.4:1.54 Fri May 10 01:59:47 2019 +++ src/share/man/man4/envsys.4 Tue May 4 13:51:55 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: envsys.4,v 1.54 2019/05/10 05:59:47 cnst Exp $ +.\" $NetBSD: envsys.4,v 1.55 2021/05/04 17:51:55 christos Exp $ .\" .\" Copyright (c) 2007 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 10, 2013 +.Dd May 4, 2021 .Dt ENVSYS 4 .Os .Sh NAME @@ -411,7 +411,7 @@ main(void) if (!prop_dictionary_set(global_dict, "aibs0", array)) err(EINVAL, "prop_dictionary_set global"); - obj = prop_string_create_cstring_nocopy("sensor0"); + obj = prop_string_create_nocopy("sensor0"); if (obj == NULL || !prop_dictionary_set(sensor_dict, "index", obj)) err(EINVAL, "sensor index"); @@ -429,7 +429,7 @@ main(void) if (!prop_array_add(array, sensor_dict)) err(EINVAL, "prop_array_add"); - if ((fd = open(_DEV_SYSMON, O_RDWR)) == \-1) + if ((fd = open(_PATH_SYSMON, O_RDWR)) == \-1) err(EXIT_FAILURE, "open"); /* we are done, send the dictionary */ @@ -437,6 +437,7 @@ main(void) fd, ENVSYS_SETDICTIONARY); prop_object_release(array); + prop_object_release(sensor_dict); prop_object_release(global_dict); (void)close(fd); return error;