CVS commit: src/sbin/modload
Module Name:src Committed By: mrg Date: Sun Jan 17 00:17:40 UTC 2021 Modified Files: src/sbin/modload: modload.8 Log Message: call it "kernel object linker module framework" not just "module framework". the latter is generic enough to also mean the old ld(1) linked loadable kernel modules. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.48 src/sbin/modload/modload.8:1.49 --- src/sbin/modload/modload.8:1.48 Mon Jun 1 03:18:36 2020 +++ src/sbin/modload/modload.8 Sun Jan 17 00:17:40 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.48 2020/06/01 03:18:36 uwe Exp $ +.\" $NetBSD: modload.8,v 1.49 2021/01/17 00:17:40 mrg Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" <> .\" -.Dd July 18, 2017 +.Dd November 13, 2020 .Dt MODLOAD 8 .Os .Sh NAME @@ -145,13 +145,15 @@ command was designed to be similar in fu to the corresponding command in .Tn "SunOS 4.1.3" . .Nm -was switched to the module framework for -.Nx 5.0 . +was switched to the kernel object linker module framework for +.Nx 5.0 , +derived from the same framework in +.Fx . .Sh AUTHORS .An -nosplit The original .Nx implementation was written by .An Terrence R. Lambert Aq Mt te...@cs.weber.edu . -The switch to the module framework was by +The switch to the kernel object linker module framework was by .An Andrew Doran Aq Mt a...@netbsd.org .
CVS commit: src/sbin/modload
Module Name:src Committed By: jnemeth Date: Tue May 19 22:09:59 UTC 2009 Modified Files: src/sbin/modload: main.c modload.8 Log Message: Add -p option which outputs a property list suitable for loading with a module. This is in preparation for having the kernel load an optional .prop alongside a module, which is useful for passing options to autoloaded modules and modules loaded at boot time. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sbin/modload/main.c cvs rdiff -u -r1.28 -r1.29 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/main.c diff -u src/sbin/modload/main.c:1.4 src/sbin/modload/main.c:1.5 --- src/sbin/modload/main.c:1.4 Wed Nov 12 12:35:53 2008 +++ src/sbin/modload/main.c Tue May 19 22:09:59 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.4 2008/11/12 12:35:53 ad Exp $ */ +/* $NetBSD: main.c,v 1.5 2009/05/19 22:09:59 jnemeth Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.4 2008/11/12 12:35:53 ad Exp $"); +__RCSID("$NetBSD: main.c,v 1.5 2009/05/19 22:09:59 jnemeth Exp $"); #endif /* !lint */ #include @@ -60,6 +60,7 @@ { modctl_load_t cmdargs; prop_dictionary_t props; + bool output_props = false; char *propsstr; int ch; int flags; @@ -67,7 +68,7 @@ flags = 0; props = prop_dictionary_create(); - while ((ch = getopt(argc, argv, "b:fi:s:")) != -1) { + while ((ch = getopt(argc, argv, "b:fi:ps:")) != -1) { switch (ch) { case 'b': parse_param(props, optarg, parse_bool_param); @@ -81,6 +82,10 @@ parse_param(props, optarg, parse_int_param); break; + case 'p': + output_props = true; + break; + case 's': parse_param(props, optarg, parse_string_param); break; @@ -93,20 +98,24 @@ argc -= optind; argv += optind; - if (argc != 1) - usage(); propsstr = prop_dictionary_externalize(props); if (propsstr == NULL) errx(EXIT_FAILURE, "Failed to process properties"); - cmdargs.ml_filename = argv[0]; - cmdargs.ml_flags = flags; - cmdargs.ml_props = propsstr; - cmdargs.ml_propslen = strlen(propsstr); + if (output_props) + puts(propsstr); + else { + if (argc != 1) + usage(); + cmdargs.ml_filename = argv[0]; + cmdargs.ml_flags = flags; + cmdargs.ml_props = propsstr; + cmdargs.ml_propslen = strlen(propsstr); - if (modctl(MODCTL_LOAD, &cmdargs)) { - err(EXIT_FAILURE, NULL); + if (modctl(MODCTL_LOAD, &cmdargs)) { + err(EXIT_FAILURE, NULL); + } } free(propsstr); @@ -192,7 +201,7 @@ (void)fprintf(stderr, "Usage: %s [-b var=boolean] [-f] [-i var=integer] " "[-s var=string]\n" - " \n", + " {-p|}\n", getprogname()); exit(EXIT_FAILURE); } Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.28 src/sbin/modload/modload.8:1.29 --- src/sbin/modload/modload.8:1.28 Mon Nov 17 02:32:09 2008 +++ src/sbin/modload/modload.8 Tue May 19 22:09:59 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.28 2008/11/17 02:32:09 uwe Exp $ +.\" $NetBSD: modload.8,v 1.29 2009/05/19 22:09:59 jnemeth Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" <> .\" -.Dd November 12, 2008 +.Dd May 19, 2009 .Dt MODLOAD 8 .Os .Sh NAME @@ -43,6 +43,7 @@ .Op Fl b Ar name=val .Op Fl f .Op Fl i Ar name=val +.Op Fl p .Op Fl s Ar name=val .Ar module .Sh DESCRIPTION @@ -80,6 +81,9 @@ .Em Note : an incompatible module can cause system instability, including data loss or corruption. +.It Fl p +Output a property list suitable for loading along with a module. +When using this option, you do not need to specify a module. .It Fl s Pass the module a string property with the name .Ar name
CVS commit: src/sbin/modload
Module Name:src Committed By: wiz Date: Tue May 19 22:35:41 UTC 2009 Modified Files: src/sbin/modload: modload.8 Log Message: Sort option descriptions. Split usage in SYNOPSIS in two, since there are two different methods of calling it. Add arguments to option descriptions. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.29 src/sbin/modload/modload.8:1.30 --- src/sbin/modload/modload.8:1.29 Tue May 19 22:09:59 2009 +++ src/sbin/modload/modload.8 Tue May 19 22:35:41 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.29 2009/05/19 22:09:59 jnemeth Exp $ +.\" $NetBSD: modload.8,v 1.30 2009/05/19 22:35:41 wiz Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -40,12 +40,16 @@ .Nd load a kernel module .Sh SYNOPSIS .Nm -.Op Fl b Ar name=val .Op Fl f +.Op Fl b Ar name=val .Op Fl i Ar name=val -.Op Fl p .Op Fl s Ar name=val .Ar module +.Nm +.Fl p +.Op Fl b Ar name=val +.Op Fl i Ar name=val +.Op Fl s Ar name=val .Sh DESCRIPTION The .Nm @@ -59,8 +63,8 @@ The options to .Nm are as follows: -.Bl -tag -width indent -.It Fl b +.Bl -tag -width xbxnamexvalx +.It Fl b Ar name=val Pass the module a boolean property with the name .Ar name . .Ar val @@ -68,11 +72,6 @@ .Dv true or .Dv false . -.It Fl i -Pass the module an integer property with the name -.Ar name -and integral value -.Ar val . .It Fl f When a module is loaded, the kernel checks if the module is compatible with the running kernel and will refuse to load modules that are @@ -81,10 +80,15 @@ .Em Note : an incompatible module can cause system instability, including data loss or corruption. +.It Fl i Ar name=val +Pass the module an integer property with the name +.Ar name +and integral value +.Ar val . .It Fl p Output a property list suitable for loading along with a module. When using this option, you do not need to specify a module. -.It Fl s +.It Fl s Ar name=val Pass the module a string property with the name .Ar name and string value
CVS commit: src/sbin/modload
Module Name:src Committed By: wiz Date: Tue May 19 22:39:52 UTC 2009 Modified Files: src/sbin/modload: main.c modload.8 Log Message: Sync usage and man page. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sbin/modload/main.c cvs rdiff -u -r1.30 -r1.31 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/main.c diff -u src/sbin/modload/main.c:1.5 src/sbin/modload/main.c:1.6 --- src/sbin/modload/main.c:1.5 Tue May 19 22:09:59 2009 +++ src/sbin/modload/main.c Tue May 19 22:39:52 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.5 2009/05/19 22:09:59 jnemeth Exp $ */ +/* $NetBSD: main.c,v 1.6 2009/05/19 22:39:52 wiz Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.5 2009/05/19 22:09:59 jnemeth Exp $"); +__RCSID("$NetBSD: main.c,v 1.6 2009/05/19 22:39:52 wiz Exp $"); #endif /* !lint */ #include @@ -199,9 +199,10 @@ { (void)fprintf(stderr, - "Usage: %s [-b var=boolean] [-f] [-i var=integer] " - "[-s var=string]\n" - " {-p|}\n", - getprogname()); + "Usage: %s [-f] [-b var=boolean] [-i var=integer] " + "[-s var=string] module\n" + " %s -p [-b var=boolean] [-i var=integer] " + "[-s var=string]\n", + getprogname(), getprogname()); exit(EXIT_FAILURE); } Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.30 src/sbin/modload/modload.8:1.31 --- src/sbin/modload/modload.8:1.30 Tue May 19 22:35:41 2009 +++ src/sbin/modload/modload.8 Tue May 19 22:39:52 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.30 2009/05/19 22:35:41 wiz Exp $ +.\" $NetBSD: modload.8,v 1.31 2009/05/19 22:39:52 wiz Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -41,15 +41,15 @@ .Sh SYNOPSIS .Nm .Op Fl f -.Op Fl b Ar name=val -.Op Fl i Ar name=val -.Op Fl s Ar name=val +.Op Fl b Ar var=boolean +.Op Fl i Ar var=integer +.Op Fl s Ar var=string .Ar module .Nm .Fl p -.Op Fl b Ar name=val -.Op Fl i Ar name=val -.Op Fl s Ar name=val +.Op Fl b Ar var=boolean +.Op Fl i Ar var=integer +.Op Fl s Ar var=string .Sh DESCRIPTION The .Nm @@ -63,11 +63,11 @@ The options to .Nm are as follows: -.Bl -tag -width xbxnamexvalx -.It Fl b Ar name=val +.Bl -tag -width xbxvarxbooleanx +.It Fl b Ar var=boolean Pass the module a boolean property with the name -.Ar name . -.Ar val +.Ar var . +.Ar boolean may be either .Dv true or @@ -80,19 +80,19 @@ .Em Note : an incompatible module can cause system instability, including data loss or corruption. -.It Fl i Ar name=val +.It Fl i Ar var=integer Pass the module an integer property with the name -.Ar name +.Ar var and integral value -.Ar val . +.Ar integer . .It Fl p Output a property list suitable for loading along with a module. When using this option, you do not need to specify a module. -.It Fl s Ar name=val +.It Fl s Ar var=string Pass the module a string property with the name -.Ar name +.Ar var and string value -.Ar val . +.Ar string . .El .Sh DIAGNOSTICS The
CVS commit: src/sbin/modload
Module Name:src Committed By: jnemeth Date: Tue May 19 22:55:24 UTC 2009 Modified Files: src/sbin/modload: main.c Log Message: fputs() instead of puts() so we don't get the silly extra blank line To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sbin/modload/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/main.c diff -u src/sbin/modload/main.c:1.6 src/sbin/modload/main.c:1.7 --- src/sbin/modload/main.c:1.6 Tue May 19 22:39:52 2009 +++ src/sbin/modload/main.c Tue May 19 22:55:24 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.6 2009/05/19 22:39:52 wiz Exp $ */ +/* $NetBSD: main.c,v 1.7 2009/05/19 22:55:24 jnemeth Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.6 2009/05/19 22:39:52 wiz Exp $"); +__RCSID("$NetBSD: main.c,v 1.7 2009/05/19 22:55:24 jnemeth Exp $"); #endif /* !lint */ #include @@ -104,7 +104,7 @@ errx(EXIT_FAILURE, "Failed to process properties"); if (output_props) - puts(propsstr); + fputs(propsstr, stdout); else { if (argc != 1) usage();
CVS commit: src/sbin/modload
Module Name:src Committed By: jnemeth Date: Thu Jun 4 02:57:01 UTC 2009 Modified Files: src/sbin/modload: main.c modload.8 Log Message: Add a "-m plist" option. This option will read in an existing .prop file and merge any options supplied on the "command line". This code will serve as the basis for in-kernel merging. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sbin/modload/main.c cvs rdiff -u -r1.31 -r1.32 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/main.c diff -u src/sbin/modload/main.c:1.7 src/sbin/modload/main.c:1.8 --- src/sbin/modload/main.c:1.7 Tue May 19 22:55:24 2009 +++ src/sbin/modload/main.c Thu Jun 4 02:57:01 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.7 2009/05/19 22:55:24 jnemeth Exp $ */ +/* $NetBSD: main.c,v 1.8 2009/06/04 02:57:01 jnemeth Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.7 2009/05/19 22:55:24 jnemeth Exp $"); +__RCSID("$NetBSD: main.c,v 1.8 2009/06/04 02:57:01 jnemeth Exp $"); #endif /* !lint */ #include @@ -54,21 +54,26 @@ static void parse_string_param(prop_dictionary_t, const char *, const char *); static void usage(void) __dead; +static void merge_dicts(prop_dictionary_t, const prop_dictionary_t); int main(int argc, char **argv) { modctl_load_t cmdargs; - prop_dictionary_t props; - bool output_props = false; + prop_dictionary_t ext_props, props; + bool merge_props, output_props; + const char *ext_file; char *propsstr; int ch; int flags; - flags = 0; + ext_file = NULL; + ext_props = NULL; props = prop_dictionary_create(); + merge_props = output_props = false; + flags = 0; - while ((ch = getopt(argc, argv, "b:fi:ps:")) != -1) { + while ((ch = getopt(argc, argv, "b:fi:m:ps:")) != -1) { switch (ch) { case 'b': parse_param(props, optarg, parse_bool_param); @@ -82,6 +87,11 @@ parse_param(props, optarg, parse_int_param); break; + case 'm': + merge_props = true; + ext_file = optarg; + break; + case 'p': output_props = true; break; @@ -103,9 +113,22 @@ if (propsstr == NULL) errx(EXIT_FAILURE, "Failed to process properties"); - if (output_props) + if (output_props) { + if (merge_props) { + ext_props = + prop_dictionary_internalize_from_file(ext_file); + if (ext_props == NULL) { +errx(EXIT_FAILURE, "Failed to read existing " +"property list"); + } + + free(propsstr); + merge_dicts(ext_props, props); + propsstr = prop_dictionary_externalize(ext_props); + } + fputs(propsstr, stdout); - else { + } else { if (argc != 1) usage(); cmdargs.ml_filename = argv[0]; @@ -201,8 +224,36 @@ (void)fprintf(stderr, "Usage: %s [-f] [-b var=boolean] [-i var=integer] " "[-s var=string] module\n" - " %s -p [-b var=boolean] [-i var=integer] " + " %s -p [-m plist] [-b var=boolean] [-i var=integer] " "[-s var=string]\n", getprogname(), getprogname()); exit(EXIT_FAILURE); } + +static void +merge_dicts(prop_dictionary_t existing_dict, const prop_dictionary_t new_dict) +{ + prop_dictionary_keysym_t props_keysym; + prop_object_iterator_t props_iter; + prop_object_t props_obj; + const char *props_key; + + props_iter = prop_dictionary_iterator(new_dict); + if (props_iter == NULL) { + errx(EXIT_FAILURE, "Failed to iterate new property list"); + } + + while ((props_obj = prop_object_iterator_next(props_iter)) != NULL) { + props_keysym = (prop_dictionary_keysym_t)props_obj; + props_key = prop_dictionary_keysym_cstring_nocopy(props_keysym); + props_obj = prop_dictionary_get_keysym(new_dict, props_keysym); + if ((props_obj == NULL) || !prop_dictionary_set(existing_dict, + props_key, props_obj)) { + errx(EXIT_FAILURE, "Failed to copy " + "existing property list"); + } + } + prop_object_iterator_release(props_iter); + + return; +} Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.31 src/sbin/modload/modload.8:1.32 --- src/sbin/modload/modload.8:1.31 Tue May 19 22:39:52 2009 +++ src/sbin/modload/modload.8 Thu Jun 4 02:57:01 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.31 2009/05/19 22:39:52 wiz Exp $ +.\" $NetBSD: modload.8,v 1.32 2009/06/04 02:57:01 jnemeth Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" <> .\" -.Dd May 19, 2009 +.Dd June 3, 2009 .Dt MODLOAD 8 .Os .Sh NAME @@ -47,6 +47,7 @@ .Ar module .Nm .Fl p +.Op Fl m Ar plist .Op Fl b Ar var=boolean .Op Fl i Ar var=integer .Op Fl s Ar var=string @@ -85,6 +86,11 @@ .Ar var and integral value .Ar integer . +.It Fl m Ar plist +When used in conjuction with +.Fl p +merge new options with an existing property list contained in +.Ar plist . .It Fl p Output a property list suitable for loading a
CVS commit: src/sbin/modload
Module Name:src Committed By: wiz Date: Fri Jun 5 09:31:07 UTC 2009 Modified Files: src/sbin/modload: main.c modload.8 Log Message: Sort options. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sbin/modload/main.c cvs rdiff -u -r1.32 -r1.33 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/main.c diff -u src/sbin/modload/main.c:1.8 src/sbin/modload/main.c:1.9 --- src/sbin/modload/main.c:1.8 Thu Jun 4 02:57:01 2009 +++ src/sbin/modload/main.c Fri Jun 5 09:31:07 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.8 2009/06/04 02:57:01 jnemeth Exp $ */ +/* $NetBSD: main.c,v 1.9 2009/06/05 09:31:07 wiz Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.8 2009/06/04 02:57:01 jnemeth Exp $"); +__RCSID("$NetBSD: main.c,v 1.9 2009/06/05 09:31:07 wiz Exp $"); #endif /* !lint */ #include @@ -224,7 +224,7 @@ (void)fprintf(stderr, "Usage: %s [-f] [-b var=boolean] [-i var=integer] " "[-s var=string] module\n" - " %s -p [-m plist] [-b var=boolean] [-i var=integer] " + " %s -p [-b var=boolean] [-i var=integer] [-m plist] " "[-s var=string]\n", getprogname(), getprogname()); exit(EXIT_FAILURE); Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.32 src/sbin/modload/modload.8:1.33 --- src/sbin/modload/modload.8:1.32 Thu Jun 4 02:57:01 2009 +++ src/sbin/modload/modload.8 Fri Jun 5 09:31:07 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.32 2009/06/04 02:57:01 jnemeth Exp $ +.\" $NetBSD: modload.8,v 1.33 2009/06/05 09:31:07 wiz Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -47,9 +47,9 @@ .Ar module .Nm .Fl p -.Op Fl m Ar plist .Op Fl b Ar var=boolean .Op Fl i Ar var=integer +.Op Fl m Ar plist .Op Fl s Ar var=string .Sh DESCRIPTION The @@ -88,7 +88,7 @@ .Ar integer . .It Fl m Ar plist When used in conjuction with -.Fl p +.Fl p , merge new options with an existing property list contained in .Ar plist . .It Fl p
CVS commit: src/sbin/modload
Module Name:src Committed By: jnemeth Date: Fri Jun 5 11:37:30 UTC 2009 Modified Files: src/sbin/modload: main.c modload.8 Log Message: Add a new [-d var] option which when combined with -p and -m will allow you to delete vars from the existing .prop file. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sbin/modload/main.c cvs rdiff -u -r1.33 -r1.34 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/main.c diff -u src/sbin/modload/main.c:1.9 src/sbin/modload/main.c:1.10 --- src/sbin/modload/main.c:1.9 Fri Jun 5 09:31:07 2009 +++ src/sbin/modload/main.c Fri Jun 5 11:37:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.9 2009/06/05 09:31:07 wiz Exp $ */ +/* $NetBSD: main.c,v 1.10 2009/06/05 11:37:30 jnemeth Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,10 +28,11 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.9 2009/06/05 09:31:07 wiz Exp $"); +__RCSID("$NetBSD: main.c,v 1.10 2009/06/05 11:37:30 jnemeth Exp $"); #endif /* !lint */ #include +#include #include #include @@ -59,26 +60,42 @@ int main(int argc, char **argv) { + SIMPLEQ_HEAD(del_head, del_item) del_head; modctl_load_t cmdargs; prop_dictionary_t ext_props, props; - bool merge_props, output_props; + bool del_props, merge_props, output_props; const char *ext_file; char *propsstr; int ch; int flags; + struct del_item { + SIMPLEQ_ENTRY(del_item) del_items; + const char *del_key; + } *delp; + + SIMPLEQ_INIT(&del_head); ext_file = NULL; ext_props = NULL; props = prop_dictionary_create(); - merge_props = output_props = false; + del_props = merge_props = output_props = false; flags = 0; - while ((ch = getopt(argc, argv, "b:fi:m:ps:")) != -1) { + while ((ch = getopt(argc, argv, "b:d:fi:m:ps:")) != -1) { switch (ch) { case 'b': parse_param(props, optarg, parse_bool_param); break; + case 'd': + del_props = true; + delp = malloc(sizeof(struct del_item)); + if (delp == NULL) +errx(EXIT_FAILURE, "Out of memory"); + delp->del_key = optarg; + SIMPLEQ_INSERT_TAIL(&del_head, delp, del_items); + break; + case 'f': flags |= MODCTL_LOAD_FORCE; break; @@ -124,7 +141,16 @@ free(propsstr); merge_dicts(ext_props, props); + + if (del_props) +SIMPLEQ_FOREACH(delp, &del_head, del_items) + prop_dictionary_remove(ext_props, + delp->del_key); + propsstr = prop_dictionary_externalize(ext_props); + if (propsstr == NULL) +errx(EXIT_FAILURE, "Failed to process " +"properties"); } fputs(propsstr, stdout); @@ -224,8 +250,8 @@ (void)fprintf(stderr, "Usage: %s [-f] [-b var=boolean] [-i var=integer] " "[-s var=string] module\n" - " %s -p [-b var=boolean] [-i var=integer] [-m plist] " - "[-s var=string]\n", + " %s -p [-b var=boolean] [-d var] [-i var=integer] " + "[-m plist]\n [-s var=string]\n", getprogname(), getprogname()); exit(EXIT_FAILURE); } Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.33 src/sbin/modload/modload.8:1.34 --- src/sbin/modload/modload.8:1.33 Fri Jun 5 09:31:07 2009 +++ src/sbin/modload/modload.8 Fri Jun 5 11:37:30 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.33 2009/06/05 09:31:07 wiz Exp $ +.\" $NetBSD: modload.8,v 1.34 2009/06/05 11:37:30 jnemeth Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" <> .\" -.Dd June 3, 2009 +.Dd June 5, 2009 .Dt MODLOAD 8 .Os .Sh NAME @@ -48,6 +48,7 @@ .Nm .Fl p .Op Fl b Ar var=boolean +.Op Fl d Ar var .Op Fl i Ar var=integer .Op Fl m Ar plist .Op Fl s Ar var=string @@ -73,6 +74,14 @@ .Dv true or .Dv false . +.It Fl d Ar var +When used in conjuction with +.Fl m , +delete +.Ar var +from the +.Ar plist +specified. .It Fl f When a module is loaded, the kernel checks if the module is compatible with the running kernel and will refuse to load modules that are @@ -94,6 +103,11 @@ .It Fl p Output a property list suitable for loading along with a module. When using this option, you do not need to specify a module. +Use +.Fl m +and +.Fl d +to read and modify an existing property list. .It Fl s Ar var=string Pass the module a string property with the name .Ar var
CVS commit: src/sbin/modload
Module Name:src Committed By: jnemeth Date: Wed Jun 10 03:30:32 UTC 2009 Modified Files: src/sbin/modload: main.c modload.8 Log Message: -p -P doesn't make much sense since no module will be loaded. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sbin/modload/main.c cvs rdiff -u -r1.35 -r1.36 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/main.c diff -u src/sbin/modload/main.c:1.11 src/sbin/modload/main.c:1.12 --- src/sbin/modload/main.c:1.11 Tue Jun 9 20:35:02 2009 +++ src/sbin/modload/main.c Wed Jun 10 03:30:32 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.11 2009/06/09 20:35:02 jnemeth Exp $ */ +/* $NetBSD: main.c,v 1.12 2009/06/10 03:30:32 jnemeth Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.11 2009/06/09 20:35:02 jnemeth Exp $"); +__RCSID("$NetBSD: main.c,v 1.12 2009/06/10 03:30:32 jnemeth Exp $"); #endif /* !lint */ #include @@ -253,7 +253,7 @@ (void)fprintf(stderr, "Usage: %s [-P] [-f] [-b var=boolean] [-i var=integer] " "[-s var=string] module\n" - " %s -p [-P] [-b var=boolean] [-d var] [-i var=integer] " + " %s -p [-b var=boolean] [-d var] [-i var=integer] " "[-m plist]\n [-s var=string]\n", getprogname(), getprogname()); exit(EXIT_FAILURE); Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.35 src/sbin/modload/modload.8:1.36 --- src/sbin/modload/modload.8:1.35 Tue Jun 9 20:35:02 2009 +++ src/sbin/modload/modload.8 Wed Jun 10 03:30:32 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.35 2009/06/09 20:35:02 jnemeth Exp $ +.\" $NetBSD: modload.8,v 1.36 2009/06/10 03:30:32 jnemeth Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -43,7 +43,6 @@ .Op Fl f .Op Fl b Ar var=boolean .Op Fl i Ar var=integer -.Op Fl P .Op Fl s Ar var=string .Ar module .Nm
CVS commit: src/sbin/modload
Module Name:src Committed By: wiz Date: Thu Jun 11 08:12:00 UTC 2009 Modified Files: src/sbin/modload: main.c Log Message: Sync usage with man page. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sbin/modload/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/main.c diff -u src/sbin/modload/main.c:1.12 src/sbin/modload/main.c:1.13 --- src/sbin/modload/main.c:1.12 Wed Jun 10 03:30:32 2009 +++ src/sbin/modload/main.c Thu Jun 11 08:12:00 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.12 2009/06/10 03:30:32 jnemeth Exp $ */ +/* $NetBSD: main.c,v 1.13 2009/06/11 08:12:00 wiz Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.12 2009/06/10 03:30:32 jnemeth Exp $"); +__RCSID("$NetBSD: main.c,v 1.13 2009/06/11 08:12:00 wiz Exp $"); #endif /* !lint */ #include @@ -251,7 +251,7 @@ { (void)fprintf(stderr, - "Usage: %s [-P] [-f] [-b var=boolean] [-i var=integer] " + "Usage: %s [-fP] [-b var=boolean] [-i var=integer] " "[-s var=string] module\n" " %s -p [-b var=boolean] [-d var] [-i var=integer] " "[-m plist]\n [-s var=string]\n",
CVS commit: src/sbin/modload
Module Name:src Committed By: wiz Date: Thu Jun 11 08:11:52 UTC 2009 Modified Files: src/sbin/modload: modload.8 Log Message: Remove -P from -p section, not from -f one. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.36 src/sbin/modload/modload.8:1.37 --- src/sbin/modload/modload.8:1.36 Wed Jun 10 03:30:32 2009 +++ src/sbin/modload/modload.8 Thu Jun 11 08:11:52 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.36 2009/06/10 03:30:32 jnemeth Exp $ +.\" $NetBSD: modload.8,v 1.37 2009/06/11 08:11:52 wiz Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -40,7 +40,7 @@ .Nd load a kernel module .Sh SYNOPSIS .Nm -.Op Fl f +.Op Fl fP .Op Fl b Ar var=boolean .Op Fl i Ar var=integer .Op Fl s Ar var=string @@ -51,7 +51,6 @@ .Op Fl d Ar var .Op Fl i Ar var=integer .Op Fl m Ar plist -.Op Fl P .Op Fl s Ar var=string .Sh DESCRIPTION The
CVS commit: src/sbin/modload
Module Name:src Committed By: apb Date: Thu Feb 7 12:04:02 UTC 2013 Modified Files: src/sbin/modload: main.c Log Message: Don't pass NULL to prop_dictionary_set. Coverity CID 275196. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sbin/modload/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/main.c diff -u src/sbin/modload/main.c:1.14 src/sbin/modload/main.c:1.15 --- src/sbin/modload/main.c:1.14 Mon Dec 13 20:48:44 2010 +++ src/sbin/modload/main.c Thu Feb 7 12:04:01 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.14 2010/12/13 20:48:44 pooka Exp $ */ +/* $NetBSD: main.c,v 1.15 2013/02/07 12:04:01 apb Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.14 2010/12/13 20:48:44 pooka Exp $"); +__RCSID("$NetBSD: main.c,v 1.15 2013/02/07 12:04:01 apb Exp $"); #endif /* !lint */ #include @@ -185,6 +185,7 @@ parse_bool_param(prop_dictionary_t props const char *value) { bool boolvalue; + prop_object_t po; assert(name != NULL); assert(value != NULL); @@ -200,7 +201,10 @@ parse_bool_param(prop_dictionary_t props else errx(EXIT_FAILURE, "Invalid boolean value `%s'", value); - prop_dictionary_set(props, name, prop_bool_create(boolvalue)); + po = prop_bool_create(boolvalue); + if (po == NULL) + err(EXIT_FAILURE, "prop_bool_create"); + prop_dictionary_set(props, name, po); } static void @@ -208,6 +212,7 @@ parse_int_param(prop_dictionary_t props, const char *value) { int64_t intvalue; + prop_object_t po; assert(name != NULL); assert(value != NULL); @@ -215,8 +220,10 @@ parse_int_param(prop_dictionary_t props, if (dehumanize_number(value, &intvalue) != 0) err(EXIT_FAILURE, "Invalid integer value `%s'", value); - prop_dictionary_set(props, name, - prop_number_create_integer(intvalue)); + po = prop_number_create_integer(intvalue); + if (po == NULL) + err(EXIT_FAILURE, "prop_number_create_integer"); + prop_dictionary_set(props, name, po); } static void @@ -243,11 +250,15 @@ static void parse_string_param(prop_dictionary_t props, const char *name, const char *value) { + prop_object_t po; assert(name != NULL); assert(value != NULL); - prop_dictionary_set(props, name, prop_string_create_cstring(value)); + po = prop_string_create_cstring(value); + if (po == NULL) + err(EXIT_FAILURE, "prop_string_create_cstring"); + prop_dictionary_set(props, name, po); } static void
CVS commit: src/sbin/modload
Module Name:src Committed By: wiz Date: Sat Aug 6 08:43:28 UTC 2011 Modified Files: src/sbin/modload: modload.8 Log Message: Quote path separator character. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.41 src/sbin/modload/modload.8:1.42 --- src/sbin/modload/modload.8:1.41 Sat Aug 6 08:11:10 2011 +++ src/sbin/modload/modload.8 Sat Aug 6 08:43:28 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.41 2011/08/06 08:11:10 mbalmer Exp $ +.\" $NetBSD: modload.8,v 1.42 2011/08/06 08:43:28 wiz Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -61,7 +61,8 @@ .Pp Modules are loaded from the default system module areas unless the .Ar module -parameter contains a path separator character (/). +parameter contains a path separator character +.Pq Sq / . .Pp The options to .Nm
CVS commit: src/sbin/modload
Module Name:src Committed By: sevan Date: Mon Sep 12 00:03:01 UTC 2016 Modified Files: src/sbin/modload: modload.8 Log Message: Document the version modload appeared and authors. Correct spelling mistakes. Bump date. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.43 src/sbin/modload/modload.8:1.44 --- src/sbin/modload/modload.8:1.43 Sat Nov 28 23:53:48 2015 +++ src/sbin/modload/modload.8 Mon Sep 12 00:03:01 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.43 2015/11/28 23:53:48 pgoyette Exp $ +.\" $NetBSD: modload.8,v 1.44 2016/09/12 00:03:01 sevan Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" <> .\" -.Dd November 29, 2015 +.Dd September 12, 2016 .Dt MODLOAD 8 .Os .Sh NAME @@ -77,7 +77,7 @@ may be either or .Dv false . .It Fl d Ar var -When used in conjuction with +When used in conjunction with .Fl m , delete .Ar var @@ -102,7 +102,7 @@ Pass the module an integer property with and integral value .Ar integer . .It Fl m Ar plist -When used in conjuction with +When used in conjunction with .Fl p , merge new options with an existing property list contained in .Ar plist . @@ -133,8 +133,22 @@ and with a nonzero status if an error oc .Xr modstat 8 , .Xr modunload 8 .Sh HISTORY +A +.Nm +utility appeared in +.Nx 0.9 . The .Nm command was designed to be similar in functionality to the corresponding command in .Tn "SunOS 4.1.3" . +.Nm +was switched to the module framework for +.Nx 5.0 . +.Sh AUTHORS +The original +.Nx +implementation was written by +.An Terrence R. Lambert Aq Mt te...@cs.weber.edu . +The switch to the module framework was by +.An Andrew Doran Aq Mt a...@netbsd.org .
CVS commit: src/sbin/modload
Module Name:src Committed By: wiz Date: Mon Sep 12 06:52:59 UTC 2016 Modified Files: src/sbin/modload: modload.8 Log Message: Add .An -nosplit. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.44 src/sbin/modload/modload.8:1.45 --- src/sbin/modload/modload.8:1.44 Mon Sep 12 00:03:01 2016 +++ src/sbin/modload/modload.8 Mon Sep 12 06:52:59 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.44 2016/09/12 00:03:01 sevan Exp $ +.\" $NetBSD: modload.8,v 1.45 2016/09/12 06:52:59 wiz Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -146,6 +146,7 @@ to the corresponding command in was switched to the module framework for .Nx 5.0 . .Sh AUTHORS +.An -nosplit The original .Nx implementation was written by
CVS commit: src/sbin/modload
Module Name:src Committed By: christos Date: Tue Jul 18 13:00:00 UTC 2017 Modified Files: src/sbin/modload: modload.8 Log Message: PR/52417: Edgar Pettijohn: modules.conf(5) not mentioned in related manuals To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.45 src/sbin/modload/modload.8:1.46 --- src/sbin/modload/modload.8:1.45 Mon Sep 12 02:52:59 2016 +++ src/sbin/modload/modload.8 Tue Jul 18 09:00:00 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.45 2016/09/12 06:52:59 wiz Exp $ +.\" $NetBSD: modload.8,v 1.46 2017/07/18 13:00:00 christos Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" <> .\" -.Dd September 12, 2016 +.Dd JUly 18, 2017 .Dt MODLOAD 8 .Os .Sh NAME @@ -129,6 +129,7 @@ utility exits with a status of 0 on succ and with a nonzero status if an error occurs. .Sh SEE ALSO .Xr modctl 2 , +.Xr modules.conf 5 , .Xr module 7 , .Xr modstat 8 , .Xr modunload 8
CVS commit: src/sbin/modload
Module Name:src Committed By: wiz Date: Tue Jul 18 19:50:54 UTC 2017 Modified Files: src/sbin/modload: modload.8 Log Message: rgument. To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.46 src/sbin/modload/modload.8:1.47 --- src/sbin/modload/modload.8:1.46 Tue Jul 18 13:00:00 2017 +++ src/sbin/modload/modload.8 Tue Jul 18 19:50:54 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.46 2017/07/18 13:00:00 christos Exp $ +.\" $NetBSD: modload.8,v 1.47 2017/07/18 19:50:54 wiz Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" <> .\" -.Dd JUly 18, 2017 +.Dd July 18, 2017 .Dt MODLOAD 8 .Os .Sh NAME
CVS commit: src/sbin/modload
Module Name:src Committed By: uwe Date: Mon Jun 1 03:18:36 UTC 2020 Modified Files: src/sbin/modload: modload.8 Log Message: Make -f description actually use the word "force" so that it can be found when searched for. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.47 src/sbin/modload/modload.8:1.48 --- src/sbin/modload/modload.8:1.47 Tue Jul 18 19:50:54 2017 +++ src/sbin/modload/modload.8 Mon Jun 1 03:18:36 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.47 2017/07/18 19:50:54 wiz Exp $ +.\" $NetBSD: modload.8,v 1.48 2020/06/01 03:18:36 uwe Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -85,6 +85,7 @@ from the .Ar plist specified. .It Fl f +Force the module to be loaded. When a module is loaded, the kernel checks if the module is compatible with the running kernel and will refuse to load modules that are potentially incompatible.
CVS commit: src/sbin/modload
Module Name:src Committed By: thorpej Date: Sun Jun 7 05:49:05 UTC 2020 Modified Files: src/sbin/modload: main.c Log Message: Update for proplib(3) API changes. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sbin/modload/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/main.c diff -u src/sbin/modload/main.c:1.17 src/sbin/modload/main.c:1.18 --- src/sbin/modload/main.c:1.17 Mon Sep 5 01:09:57 2016 +++ src/sbin/modload/main.c Sun Jun 7 05:49:05 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.17 2016/09/05 01:09:57 sevan Exp $ */ +/* $NetBSD: main.c,v 1.18 2020/06/07 05:49:05 thorpej Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.17 2016/09/05 01:09:57 sevan Exp $"); +__RCSID("$NetBSD: main.c,v 1.18 2020/06/07 05:49:05 thorpej Exp $"); #endif /* !lint */ #include @@ -184,7 +184,6 @@ parse_bool_param(prop_dictionary_t props const char *value) { bool boolvalue; - prop_object_t po; assert(name != NULL); assert(value != NULL); @@ -200,10 +199,8 @@ parse_bool_param(prop_dictionary_t props else errx(EXIT_FAILURE, "Invalid boolean value `%s'", value); - po = prop_bool_create(boolvalue); - if (po == NULL) - err(EXIT_FAILURE, "prop_bool_create"); - prop_dictionary_set(props, name, po); + if (!prop_dictionary_set_bool(props, name, boolvalue)) + err(EXIT_FAILURE, "prop_dictionary_set_bool"); } static void @@ -211,7 +208,6 @@ parse_int_param(prop_dictionary_t props, const char *value) { int64_t intvalue; - prop_object_t po; assert(name != NULL); assert(value != NULL); @@ -219,10 +215,8 @@ parse_int_param(prop_dictionary_t props, if (dehumanize_number(value, &intvalue) != 0) err(EXIT_FAILURE, "Invalid integer value `%s'", value); - po = prop_number_create_integer(intvalue); - if (po == NULL) - err(EXIT_FAILURE, "prop_number_create_integer"); - prop_dictionary_set(props, name, po); + if (!prop_dictionary_set_int64(props, name, intvalue)) + err(EXIT_FAILURE, "prop_dictionary_set_int64"); } static void @@ -249,15 +243,12 @@ static void parse_string_param(prop_dictionary_t props, const char *name, const char *value) { - prop_object_t po; assert(name != NULL); assert(value != NULL); - po = prop_string_create_cstring(value); - if (po == NULL) - err(EXIT_FAILURE, "prop_string_create_cstring"); - prop_dictionary_set(props, name, po); + if (!prop_dictionary_set_string(props, name, value)) + err(EXIT_FAILURE, "prop_dictionary_set_string"); } static void @@ -288,7 +279,7 @@ merge_dicts(prop_dictionary_t existing_d while ((props_obj = prop_object_iterator_next(props_iter)) != NULL) { props_keysym = (prop_dictionary_keysym_t)props_obj; - props_key = prop_dictionary_keysym_cstring_nocopy(props_keysym); + props_key = prop_dictionary_keysym_value(props_keysym); props_obj = prop_dictionary_get_keysym(new_dict, props_keysym); if ((props_obj == NULL) || !prop_dictionary_set(existing_dict, props_key, props_obj)) {