Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/man/man4 Fix code example (from RVP)



details:   https://anonhg.NetBSD.org/src/rev/4f10f44c2637
branches:  trunk
changeset: 379018:4f10f44c2637
user:      christos <christos%NetBSD.org@localhost>
date:      Tue May 04 17:51:55 2021 +0000

description:
Fix code example (from RVP)

diffstat:

 share/man/man4/envsys.4 |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (44 lines):

diff -r b65fa5d728eb -r 4f10f44c2637 share/man/man4/envsys.4
--- a/share/man/man4/envsys.4   Tue May 04 17:47:51 2021 +0000
+++ b/share/man/man4/envsys.4   Tue May 04 17:51:55 2021 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index