Module Name:    src
Committed By:   jym
Date:           Fri Sep 30 22:08:20 UTC 2011

Modified Files:
        src/common/include/prop: prop_array.h prop_dictionary.h
        src/common/lib/libprop: prop_array.3 prop_dictionary.3 prop_kern.c
            prop_send_syscall.3
        src/distrib/sets/lists/comp: mi
        src/lib/libprop: Makefile
        src/lib/libquota: getufsquota.c
        src/usr.bin/quota: getvfsquota.c
        src/usr.sbin/edquota: edquota.c
        src/usr.sbin/quotaon: quotaon.c
        src/usr.sbin/repquota: repquota.c

Log Message:
Fix an implementation inconsistency with the prop_*_send_syscall() and
prop_*_recv_syscall() functions from proplib(3). They now share the
same logic as the one from prop_*_send_ioctl() functions:
- returns an int
- 0 indicates "no error", otherwise returns the error number (and
set errno)

Many consumers of the prop_*_{ioctl, syscall} expect errno to be set
on error and use err() to display the error message. As such, ensures that
errno gets set before returning from these functions.

prop_*_send_syscall() functions returned a boolean, and now return an int.
Fix all call sites to use the new paradigm (only quota2 is affected in src).

As the prop_*_{send,recv}_syscall() API appeared in -current and is only
used by the recent quota2 code, I am not bumping the lib. The API change
only affects the prop_*_send_syscall() function (recv_syscall()s were
already used correctly), so ensure you are not mixing "old" -current
quota binaries with a new proplib(3) (or the other way around). This
change will be announced via a HEADS-UP and UPDATING.

Does not affect the kernel part of proplib.

Document the correct API in prop_array(3) and prop_dictionary(3).

Thanks to Francois Tigeot for noticing the API inconsistency and
reporting it on tech-kern@.

ok bouyer@.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/common/include/prop/prop_array.h
cvs rdiff -u -r1.13 -r1.14 src/common/include/prop/prop_dictionary.h
cvs rdiff -u -r1.12 -r1.13 src/common/lib/libprop/prop_array.3
cvs rdiff -u -r1.17 -r1.18 src/common/lib/libprop/prop_dictionary.3
cvs rdiff -u -r1.16 -r1.17 src/common/lib/libprop/prop_kern.c
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libprop/prop_send_syscall.3
cvs rdiff -u -r1.1682 -r1.1683 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.18 -r1.19 src/lib/libprop/Makefile
cvs rdiff -u -r1.2 -r1.3 src/lib/libquota/getufsquota.c
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/quota/getvfsquota.c
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/edquota/edquota.c
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/quotaon/quotaon.c
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/repquota/repquota.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/include/prop/prop_array.h
diff -u src/common/include/prop/prop_array.h:1.12 src/common/include/prop/prop_array.h:1.13
--- src/common/include/prop/prop_array.h:1.12	Thu Mar 24 17:05:39 2011
+++ src/common/include/prop/prop_array.h	Fri Sep 30 22:08:18 2011
@@ -1,4 +1,4 @@
-/*     $NetBSD: prop_array.h,v 1.12 2011/03/24 17:05:39 bouyer Exp $    */
+/*     $NetBSD: prop_array.h,v 1.13 2011/09/30 22:08:18 jym Exp $    */
 
 /*-
  * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc.
@@ -70,10 +70,12 @@ struct plistref;
 
 #if !defined(_KERNEL) && !defined(_STANDALONE)
 bool		prop_array_externalize_to_pref(prop_array_t, struct plistref *);
+bool		prop_array_internalize_from_pref(const struct plistref *,
+		                                 prop_array_t *);
 int		prop_array_send_ioctl(prop_array_t, int, unsigned long);
 int		prop_array_recv_ioctl(int, unsigned long, prop_array_t *);
-bool		prop_array_send_syscall(prop_array_t, struct plistref *);
-bool		prop_array_recv_syscall(const struct plistref *,
+int		prop_array_send_syscall(prop_array_t, struct plistref *);
+int		prop_array_recv_syscall(const struct plistref *,
 					prop_array_t *);
 #elif defined(_KERNEL)
 int		prop_array_copyin(const struct plistref *, prop_array_t *);

Index: src/common/include/prop/prop_dictionary.h
diff -u src/common/include/prop/prop_dictionary.h:1.13 src/common/include/prop/prop_dictionary.h:1.14
--- src/common/include/prop/prop_dictionary.h:1.13	Thu Mar 24 17:05:39 2011
+++ src/common/include/prop/prop_dictionary.h	Fri Sep 30 22:08:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: prop_dictionary.h,v 1.13 2011/03/24 17:05:39 bouyer Exp $	*/
+/*	$NetBSD: prop_dictionary.h,v 1.14 2011/09/30 22:08:18 jym Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc.
@@ -86,6 +86,8 @@ struct plistref;
 
 #if !defined(_KERNEL) && !defined(_STANDALONE)
 bool		prop_dictionary_externalize_to_pref(prop_dictionary_t, struct plistref *);
+bool		prop_dictionary_internalize_from_pref(const struct plistref *,
+		                                      prop_dictionary_t *);
 int		prop_dictionary_send_ioctl(prop_dictionary_t, int,
 					   unsigned long);
 int		prop_dictionary_recv_ioctl(int, unsigned long,
@@ -93,9 +95,9 @@ int		prop_dictionary_recv_ioctl(int, uns
 int		prop_dictionary_sendrecv_ioctl(prop_dictionary_t,
 					       int, unsigned long,
 					       prop_dictionary_t *);
-bool		prop_dictionary_send_syscall(prop_dictionary_t,
+int		prop_dictionary_send_syscall(prop_dictionary_t,
 		     struct plistref *);
-bool		prop_dictionary_recv_syscall(const struct plistref *,
+int		prop_dictionary_recv_syscall(const struct plistref *,
 					   prop_dictionary_t *);
 #elif defined(_KERNEL)
 int		prop_dictionary_copyin(const struct plistref *,

Index: src/common/lib/libprop/prop_array.3
diff -u src/common/lib/libprop/prop_array.3:1.12 src/common/lib/libprop/prop_array.3:1.13
--- src/common/lib/libprop/prop_array.3:1.12	Mon Feb 21 13:42:57 2011
+++ src/common/lib/libprop/prop_array.3	Fri Sep 30 22:08:18 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: prop_array.3,v 1.12 2011/02/21 13:42:57 njoly Exp $
+.\"	$NetBSD: prop_array.3,v 1.13 2011/09/30 22:08:18 jym Exp $
 .\"
 .\" Copyright (c) 2006, 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -51,6 +51,7 @@
 .Nm prop_array_externalize_to_file ,
 .Nm prop_array_internalize_from_file ,
 .Nm prop_array_externalize_to_pref ,
+.Nm prop_array_internalize_from_pref ,
 .Nm prop_array_equals
 .Nd array property collection object
 .Sh LIBRARY
@@ -104,6 +105,9 @@
 .\"
 .Ft bool
 .Fn prop_array_externalize_to_pref "prop_array_t array" "struct plistref *pref"
+.Ft bool
+.Fn prop_array_internalize_from_pref "const struct plistref *pref" \
+    "prop_array_t *arrayp"
 .\"
 .Ft bool
 .Fn prop_array_equals "prop_array_t array1" "prop_array_t array2"
@@ -266,12 +270,20 @@ Returns
 .Dv NULL
 on failure.
 .It Fn prop_array_externalize_to_pref "prop_array_t array" \
-	"struct plistref *pref"
+    "struct plistref *pref"
 Externalizes an array and packs it into the plistref specified by
 .Fa pref .
 Returns
 .Dv false
 if externalizing the array fails for any reason.
+.It Fn prop_array_internalize_from_pref "const struct plistref *pref" \
+    "prop_array_t *arrayp"
+Reads the plistref specified by
+.Fa pref ,
+internalizes it, and returns the corresponding array.
+Returns
+.Dv false
+if internalizing or writing the array fails for any reason.
 .It Fn prop_array_equals "prop_array_t array1" "prop_array_t array2"
 Returns
 .Dv true

Index: src/common/lib/libprop/prop_dictionary.3
diff -u src/common/lib/libprop/prop_dictionary.3:1.17 src/common/lib/libprop/prop_dictionary.3:1.18
--- src/common/lib/libprop/prop_dictionary.3:1.17	Mon Feb 21 13:42:57 2011
+++ src/common/lib/libprop/prop_dictionary.3	Fri Sep 30 22:08:18 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: prop_dictionary.3,v 1.17 2011/02/21 13:42:57 njoly Exp $
+.\"	$NetBSD: prop_dictionary.3,v 1.18 2011/09/30 22:08:18 jym Exp $
 .\"
 .\" Copyright (c) 2006, 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -53,6 +53,7 @@
 .Nm prop_dictionary_externalize_to_file ,
 .Nm prop_dictionary_internalize_from_file ,
 .Nm prop_dictionary_externalize_to_pref ,
+.Nm prop_dictionary_internalize_from_pref ,
 .Nm prop_dictionary_equals ,
 .Nm prop_dictionary_keysym_cstring_nocopy ,
 .Nm prop_dictionary_keysym_equals
@@ -130,6 +131,9 @@
 .Ft bool
 .Fn prop_dictionary_externalize_to_pref "prop_dictionary_t dict" \
     "struct plistref *pref"
+.Ft bool
+.Fn prop_dictionary_internalize_from_pref "const struct plistref *pref" \
+    "prop_dictionary_t *dictp"
 .\"
 .Sh DESCRIPTION
 The
@@ -324,6 +328,14 @@ Externalizes a dictionary and packs it i
 Returns
 .Dv false
 if externalizing the dictionary fails for any reason.
+.It Fn prop_dictionary_internalize_from_pref "const struct plistref *pref" \
+    "prop_dictionary_t *dictp"
+Reads the plistref specified by
+.Fa pref ,
+internalizes it, and returns the corresponding dictionary.
+Returns
+.Dv false
+if internalizing or writing the dictionary fails for any reason.
 .El
 .Sh SEE ALSO
 .Xr prop_array 3 ,

Index: src/common/lib/libprop/prop_kern.c
diff -u src/common/lib/libprop/prop_kern.c:1.16 src/common/lib/libprop/prop_kern.c:1.17
--- src/common/lib/libprop/prop_kern.c:1.16	Thu Jan 20 11:17:58 2011
+++ src/common/lib/libprop/prop_kern.c	Fri Sep 30 22:08:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: prop_kern.c,v 1.16 2011/01/20 11:17:58 bouyer Exp $	*/
+/*	$NetBSD: prop_kern.c,v 1.17 2011/09/30 22:08:18 jym Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc.
@@ -49,7 +49,8 @@
 #endif
 
 static int
-_prop_object_externalize_to_pref(prop_object_t obj, struct plistref *pref, char **bufp)
+_prop_object_externalize_to_pref(prop_object_t obj, struct plistref *pref,
+	       			 char **bufp)
 {
 	char *buf;
 
@@ -75,10 +76,6 @@ _prop_object_externalize_to_pref(prop_ob
 	return (0);
 }
 
-/*
- * prop_array_externalize_to_pref --
- *	Externalize an array into a plistref for sending to the kernel.
- */
 bool
 prop_array_externalize_to_pref(prop_array_t array, struct plistref *prefp)
 {
@@ -90,14 +87,23 @@ prop_array_externalize_to_pref(prop_arra
 		errno = rv;	/* pass up error value in errno */
 	return (rv == 0);
 }
-__strong_alias(prop_array_send_syscall, prop_array_externalize_to_pref)
 
 /*
- * prop_dictionary_externalize_to_pref --
- *	Externalize an dictionary into a plistref for sending to the kernel.
+ * prop_array_externalize_to_pref --
+ *	Externalize an array into a plistref for sending to the kernel.
  */
+int
+prop_array_send_syscall(prop_array_t array, struct plistref *prefp)
+{
+	if (prop_array_externalize_to_pref(array, prefp))
+		return 0;
+	else
+		return errno;
+}
+
 bool
-prop_dictionary_externalize_to_pref(prop_dictionary_t dict, struct plistref *prefp)
+prop_dictionary_externalize_to_pref(prop_dictionary_t dict,
+				    struct plistref *prefp)
 {
 	char *buf;
 	int rv;
@@ -107,8 +113,20 @@ prop_dictionary_externalize_to_pref(prop
 		errno = rv;	/* pass up error value in errno */
 	return (rv == 0);
 }
-__strong_alias(prop_dictionary_send_syscall,
-    prop_dictionary_externalize_to_pref)
+
+/*
+ * prop_dictionary_externalize_to_pref --
+ *	Externalize an dictionary into a plistref for sending to the kernel.
+ */
+int
+prop_dictionary_send_syscall(prop_dictionary_t dict,
+			     struct plistref *prefp)
+{
+	if (prop_dictionary_externalize_to_pref(dict, prefp))
+		return 0;
+	else
+		return errno;
+}
 
 static int
 _prop_object_send_ioctl(prop_object_t obj, int fd, unsigned long cmd)
@@ -138,8 +156,14 @@ _prop_object_send_ioctl(prop_object_t ob
 int
 prop_array_send_ioctl(prop_array_t array, int fd, unsigned long cmd)
 {
+	int rv;
 
-	return (_prop_object_send_ioctl(array, fd, cmd));
+	rv = _prop_object_send_ioctl(array, fd, cmd);
+	if (rv != 0) {
+		errno = rv;	/* pass up error value in errno */
+		return rv;
+	} else 
+		return 0;
 }
 
 /*
@@ -149,13 +173,19 @@ prop_array_send_ioctl(prop_array_t array
 int
 prop_dictionary_send_ioctl(prop_dictionary_t dict, int fd, unsigned long cmd)
 {
+	int rv;
 
-	return (_prop_object_send_ioctl(dict, fd, cmd));
+	rv = _prop_object_send_ioctl(dict, fd, cmd);
+	if (rv != 0) {
+		errno = rv;	/* pass up error value in errno */
+		return rv;
+	} else 
+		return 0;
 }
 
 static int
-_prop_object_internalize_from_pref(const struct plistref *pref, prop_type_t type,
-			 prop_object_t *objp)
+_prop_object_internalize_from_pref(const struct plistref *pref,
+				   prop_type_t type, prop_object_t *objp)
 {
 	prop_object_t obj = NULL;
 	char *buf;
@@ -193,60 +223,112 @@ _prop_object_internalize_from_pref(const
 }
 
 /*
- * prop_array_recv_ioctl --
- *	Receive an array from the kernel using the specified ioctl.
+ * prop_array_internalize_from_pref --
+ * 	Internalize a pref into a prop_array_t object.
  */
-int
-prop_array_recv_ioctl(int fd, unsigned long cmd, prop_array_t *arrayp)
+bool
+prop_array_internalize_from_pref(const struct plistref *prefp,
+				 prop_array_t *arrayp)
 {
-	struct plistref pref;
+	int rv;
 
-	if (ioctl(fd, cmd, &pref) == -1)
-		return (errno);
-	
-	return (_prop_object_internalize_from_pref(&pref, PROP_TYPE_ARRAY,
-					 (prop_object_t *)arrayp));
+	rv = _prop_object_internalize_from_pref(prefp, PROP_TYPE_ARRAY,
+	    (prop_object_t *)arrayp);
+	if (rv != 0)
+		errno = rv;     /* pass up error value in errno */
+	return (rv == 0);
 }
 
 /*
- * prop_dictionary_recv_ioctl --
- *	Receive a dictionary from the kernel using the specified ioctl.
+ * prop_array_recv_syscall --
+ * 	Internalize an array received from the kernel as pref.
  */
 int
-prop_dictionary_recv_ioctl(int fd, unsigned long cmd, prop_dictionary_t *dictp)
+prop_array_recv_syscall(const struct plistref *prefp,
+			prop_array_t *arrayp)
 {
-	struct plistref pref;
-
-	if (ioctl(fd, cmd, &pref) == -1)
-		return (errno);
-
-	return (_prop_object_internalize_from_pref(&pref, PROP_TYPE_DICTIONARY,
-					 (prop_object_t *)dictp));
+	if (prop_array_internalize_from_pref(prefp, arrayp))
+		return 0;
+	else
+		return errno;
 }
 
 /*
- * prop_array_recv_syscall --
- *	Receive an array from the kernel as pref.
- *	Pref's buf is freed on exit
+ * prop_dictionary_internalize_from_pref --
+ * 	Internalize a pref into a prop_dictionary_t object.
  */
 bool
-prop_array_recv_syscall(const struct plistref *pref, prop_array_t *arrayp)
+prop_dictionary_internalize_from_pref(const struct plistref *prefp,
+				      prop_dictionary_t *dictp)
 {
-	return (_prop_object_internalize_from_pref(pref, PROP_TYPE_ARRAY,
-					 (prop_object_t *)arrayp));
+	int rv;
+
+	rv = _prop_object_internalize_from_pref(prefp, PROP_TYPE_DICTIONARY,
+	    (prop_object_t *)dictp);
+	if (rv != 0)
+		errno = rv;     /* pass up error value in errno */
+	return (rv == 0);
 }
 
 /*
  * prop_dictionary_recv_syscall --
- *	Receive a dictionary from the kernel as pref.
- *	Pref's buf is freed on exit
+ *	Internalize a dictionary received from the kernel as pref.
  */
-bool
-prop_dictionary_recv_syscall(const struct plistref *pref,
-    prop_dictionary_t *dictp)
+int
+prop_dictionary_recv_syscall(const struct plistref *prefp,
+			     prop_dictionary_t *dictp)
 {
-	return (_prop_object_internalize_from_pref(pref, PROP_TYPE_DICTIONARY,
-					 (prop_object_t *)dictp));
+	if (prop_dictionary_internalize_from_pref(prefp, dictp))
+		return 0;
+	else
+		return errno;
+}
+
+
+/*
+ * prop_array_recv_ioctl --
+ *	Receive an array from the kernel using the specified ioctl.
+ */
+int
+prop_array_recv_ioctl(int fd, unsigned long cmd, prop_array_t *arrayp)
+{
+	int rv;
+	struct plistref pref;
+
+	rv = ioctl(fd, cmd, &pref);
+	if (rv == -1)
+		return errno;
+
+	rv = _prop_object_internalize_from_pref(&pref, PROP_TYPE_ARRAY,
+			    (prop_object_t *)arrayp);
+	if (rv != 0) {
+		errno = rv;     /* pass up error value in errno */
+		return rv;
+	} else
+		return 0;
+}
+
+/*
+ * prop_dictionary_recv_ioctl --
+ *	Receive a dictionary from the kernel using the specified ioctl.
+ */
+int
+prop_dictionary_recv_ioctl(int fd, unsigned long cmd, prop_dictionary_t *dictp)
+{
+	int rv;
+	struct plistref pref;
+
+	rv = ioctl(fd, cmd, &pref);
+	if (rv == -1)
+		return errno;
+
+	rv = _prop_object_internalize_from_pref(&pref, PROP_TYPE_DICTIONARY,
+			    (prop_object_t *)dictp);
+	if (rv != 0) {
+		errno = rv;     /* pass up error value in errno */
+		return rv;
+	} else
+		return 0;
 }
 
 /*
@@ -263,8 +345,10 @@ prop_dictionary_sendrecv_ioctl(prop_dict
 	int error;
 
 	error = _prop_object_externalize_to_pref(dict, &pref, &buf);
-	if (error)
-		return (error);
+	if (error != 0) {
+		errno = error;
+		return error;
+	}
 
 	if (ioctl(fd, cmd, &pref) == -1)
 		error = errno;
@@ -273,11 +357,16 @@ prop_dictionary_sendrecv_ioctl(prop_dict
 	
 	free(buf);
 
-	if (error)
-		return (error);
+	if (error != 0)
+		return error;
 
-	return (_prop_object_internalize_from_pref(&pref, PROP_TYPE_DICTIONARY,
-			    (prop_object_t *)dictp));
+	error = _prop_object_internalize_from_pref(&pref, PROP_TYPE_DICTIONARY,
+			    (prop_object_t *)dictp);
+	if (error != 0) {
+		errno = error;     /* pass up error value in errno */
+		return error;
+	} else
+		return 0;
 }
 #endif /* !_KERNEL && !_STANDALONE */
 

Index: src/common/lib/libprop/prop_send_syscall.3
diff -u src/common/lib/libprop/prop_send_syscall.3:1.4 src/common/lib/libprop/prop_send_syscall.3:1.5
--- src/common/lib/libprop/prop_send_syscall.3:1.4	Sun Jun 19 08:53:02 2011
+++ src/common/lib/libprop/prop_send_syscall.3	Fri Sep 30 22:08:18 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: prop_send_syscall.3,v 1.4 2011/06/19 08:53:02 pgoyette Exp $
+.\"	$NetBSD: prop_send_syscall.3,v 1.5 2011/09/30 22:08:18 jym Exp $
 .\"
 .\" Copyright (c) 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -38,15 +38,15 @@
 .Nd send and receive property lists to and from the kernel using syscalls
 .Sh SYNOPSIS
 .In prop/proplib.h
-.Ft bool
+.Ft int
 .Fn prop_array_send_syscall "prop_array_t array" "struct plistref *prefp"
-.Ft bool
+.Ft int
 .Fn prop_array_recv_syscall "const struct plistref *prefp" \
     "prop_array_t *arrayp"
-.Ft bool
+.Ft int
 .Fn prop_dictionary_send_syscall "prop_dictionary_t dict" \
     "struct plistref *prefp"
-.Ft bool
+.Ft int
 .Fn prop_dictionary_recv_syscall "const struct plistref *prefp" \
     "prop_dictionary_t *dictp"
 .Sh DESCRIPTION
@@ -60,7 +60,8 @@ functions implement the user space side 
 lists to and from the kernel using
 .Xr syscall 2 .
 .Sh RETURN VALUES
-If successful, the functions return true, false otherwise.
+If successful, functions return zero.
+Otherwise, an error number is returned to indicate the error.
 .Sh EXAMPLES
 The following
 .Pq simplified
@@ -87,12 +88,34 @@ foo_getprops(void)
     struct pref pref;
 
     (void) my_syscall_get(\*[Am]pref);
-    if (!prop_dictionary_recv_syscall(\*[Am]pref, \*[Am]dict))
+    if (prop_dictionary_recv_syscall(\*[Am]pref, \*[Am]dict) != 0)
         return (NULL);
 
     return (dict);
 }
 .Ed
+.Sh ERRORS
+.Fn prop_array_send_syscall
+and
+.Fn prop_dictionary_send_syscall
+will fail if:
+.Bl -tag -width Er
+.It Bq Er ENOMEM
+Cannot allocate memory
+.It Bq Er ENOTSUP
+Not supported
+.El
+.Pp
+.Fn prop_array_recv_syscall
+and
+.Fn prop_dictionary_recv_syscall
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EIO
+Input/output error
+.It Bq Er ENOTSUP
+Not supported
+.El
 .Sh SEE ALSO
 .Xr prop_array 3 ,
 .Xr prop_dictionary 3 ,

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1682 src/distrib/sets/lists/comp/mi:1.1683
--- src/distrib/sets/lists/comp/mi:1.1682	Thu Sep 29 20:59:27 2011
+++ src/distrib/sets/lists/comp/mi	Fri Sep 30 22:08:18 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1682 2011/09/29 20:59:27 christos Exp $
+#	$NetBSD: mi,v 1.1683 2011/09/30 22:08:18 jym Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -8187,6 +8187,7 @@
 ./usr/share/man/cat3/prop_array_get_uint8.0	comp-c-catman		.cat
 ./usr/share/man/cat3/prop_array_internalize.0	comp-c-catman		.cat
 ./usr/share/man/cat3/prop_array_internalize_from_file.0	comp-c-catman		.cat
+./usr/share/man/cat3/prop_array_internalize_from_pref.0	comp-c-catman		.cat
 ./usr/share/man/cat3/prop_array_iterator.0	comp-c-catman		.cat
 ./usr/share/man/cat3/prop_array_make_immutable.0	comp-c-catman		.cat
 ./usr/share/man/cat3/prop_array_mutable.0	comp-c-catman		.cat
@@ -8250,6 +8251,7 @@
 ./usr/share/man/cat3/prop_dictionary_ingest.0	comp-c-catman		.cat
 ./usr/share/man/cat3/prop_dictionary_internalize.0	comp-c-catman		.cat
 ./usr/share/man/cat3/prop_dictionary_internalize_from_file.0	comp-c-catman		.cat
+./usr/share/man/cat3/prop_dictionary_internalize_from_pref.0	comp-c-catman		.cat
 ./usr/share/man/cat3/prop_dictionary_iterator.0	comp-c-catman		.cat
 ./usr/share/man/cat3/prop_dictionary_keysym_cstring_nocopy.0	comp-c-catman		.cat
 ./usr/share/man/cat3/prop_dictionary_keysym_equals.0	comp-c-catman		.cat
@@ -14342,6 +14344,7 @@
 ./usr/share/man/html3/prop_array_get_uint8.html	comp-c-htmlman		html
 ./usr/share/man/html3/prop_array_internalize.html	comp-c-htmlman		html
 ./usr/share/man/html3/prop_array_internalize_from_file.html	comp-c-htmlman		html
+./usr/share/man/html3/prop_array_internalize_from_pref.html	comp-c-htmlman		html
 ./usr/share/man/html3/prop_array_iterator.html	comp-c-htmlman		html
 ./usr/share/man/html3/prop_array_make_immutable.html	comp-c-htmlman		html
 ./usr/share/man/html3/prop_array_mutable.html	comp-c-htmlman		html
@@ -14405,6 +14408,7 @@
 ./usr/share/man/html3/prop_dictionary_ingest.html	comp-c-htmlman		html
 ./usr/share/man/html3/prop_dictionary_internalize.html	comp-c-htmlman		html
 ./usr/share/man/html3/prop_dictionary_internalize_from_file.html	comp-c-htmlman		html
+./usr/share/man/html3/prop_dictionary_internalize_from_pref.html	comp-c-htmlman		html
 ./usr/share/man/html3/prop_dictionary_iterator.html	comp-c-htmlman		html
 ./usr/share/man/html3/prop_dictionary_keysym_cstring_nocopy.html	comp-c-htmlman		html
 ./usr/share/man/html3/prop_dictionary_keysym_equals.html	comp-c-htmlman		html
@@ -20489,6 +20493,7 @@
 ./usr/share/man/man3/prop_array_get_uint8.3	comp-c-man		.man
 ./usr/share/man/man3/prop_array_internalize.3	comp-c-man		.man
 ./usr/share/man/man3/prop_array_internalize_from_file.3	comp-c-man		.man
+./usr/share/man/man3/prop_array_internalize_from_pref.3	comp-c-man		.man
 ./usr/share/man/man3/prop_array_iterator.3	comp-c-man		.man
 ./usr/share/man/man3/prop_array_make_immutable.3	comp-c-man		.man
 ./usr/share/man/man3/prop_array_mutable.3	comp-c-man		.man
@@ -20552,6 +20557,7 @@
 ./usr/share/man/man3/prop_dictionary_ingest.3	comp-c-man		.man
 ./usr/share/man/man3/prop_dictionary_internalize.3	comp-c-man		.man
 ./usr/share/man/man3/prop_dictionary_internalize_from_file.3	comp-c-man		.man
+./usr/share/man/man3/prop_dictionary_internalize_from_pref.3	comp-c-man		.man
 ./usr/share/man/man3/prop_dictionary_iterator.3	comp-c-man		.man
 ./usr/share/man/man3/prop_dictionary_keysym_cstring_nocopy.3	comp-c-man		.man
 ./usr/share/man/man3/prop_dictionary_keysym_equals.3	comp-c-man		.man

Index: src/lib/libprop/Makefile
diff -u src/lib/libprop/Makefile:1.18 src/lib/libprop/Makefile:1.19
--- src/lib/libprop/Makefile:1.18	Wed Jan 19 20:34:24 2011
+++ src/lib/libprop/Makefile	Fri Sep 30 22:08:19 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.18 2011/01/19 20:34:24 bouyer Exp $
+#	$NetBSD: Makefile,v 1.19 2011/09/30 22:08:19 jym Exp $
 
 .include <bsd.own.mk>
 
@@ -76,6 +76,7 @@ MLINKS+= prop_array.3 prop_array_externa
 MLINKS+= prop_array.3 prop_array_get.3
 MLINKS+= prop_array.3 prop_array_internalize.3
 MLINKS+= prop_array.3 prop_array_internalize_from_file.3
+MLINKS+= prop_array.3 prop_array_internalize_from_pref.3
 MLINKS+= prop_array.3 prop_array_iterator.3
 MLINKS+= prop_array.3 prop_array_make_immutable.3
 MLINKS+= prop_array.3 prop_array_mutable.3
@@ -135,6 +136,7 @@ MLINKS+= prop_dictionary.3 prop_dictiona
 MLINKS+= prop_dictionary.3 prop_dictionary_get_keysym.3
 MLINKS+= prop_dictionary.3 prop_dictionary_internalize.3
 MLINKS+= prop_dictionary.3 prop_dictionary_internalize_from_file.3
+MLINKS+= prop_dictionary.3 prop_dictionary_internalize_from_pref.3
 MLINKS+= prop_dictionary.3 prop_dictionary_iterator.3
 MLINKS+= prop_dictionary.3 prop_dictionary_keysym_cstring_nocopy.3
 MLINKS+= prop_dictionary.3 prop_dictionary_keysym_equals.3

Index: src/lib/libquota/getufsquota.c
diff -u src/lib/libquota/getufsquota.c:1.2 src/lib/libquota/getufsquota.c:1.3
--- src/lib/libquota/getufsquota.c:1.2	Tue Jun  7 14:56:12 2011
+++ src/lib/libquota/getufsquota.c	Fri Sep 30 22:08:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: getufsquota.c,v 1.2 2011/06/07 14:56:12 bouyer Exp $ */
+/*	$NetBSD: getufsquota.c,v 1.3 2011/09/30 22:08:19 jym Exp $ */
 
 /*-
   * Copyright (c) 2011 Manuel Bouyer
@@ -27,7 +27,7 @@
   */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: getufsquota.c,v 1.2 2011/06/07 14:56:12 bouyer Exp $");
+__RCSID("$NetBSD: getufsquota.c,v 1.3 2011/09/30 22:08:19 jym Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -90,14 +90,14 @@ getufsquota(const char *mp, struct ufs_q
 		goto end_dict;
 	}
 
-	if (!prop_dictionary_send_syscall(dict, &pref))
+	if (prop_dictionary_send_syscall(dict, &pref) != 0)
 		goto end_dict;
 	prop_object_release(dict);
 
 	if (quotactl(mp, &pref) != 0)
 		return -1;
 	
-	if ((errno = prop_dictionary_recv_syscall(&pref, &dict)) != 0)
+	if (prop_dictionary_recv_syscall(&pref, &dict) != 0)
 		return -1;
 	
 	if ((errno = quota_get_cmds(dict, &cmds)) != 0)

Index: src/usr.bin/quota/getvfsquota.c
diff -u src/usr.bin/quota/getvfsquota.c:1.7 src/usr.bin/quota/getvfsquota.c:1.8
--- src/usr.bin/quota/getvfsquota.c:1.7	Tue Jun  7 14:56:13 2011
+++ src/usr.bin/quota/getvfsquota.c	Fri Sep 30 22:08:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: getvfsquota.c,v 1.7 2011/06/07 14:56:13 bouyer Exp $ */
+/*	$NetBSD: getvfsquota.c,v 1.8 2011/09/30 22:08:19 jym Exp $ */
 
 /*-
   * Copyright (c) 2011 Manuel Bouyer
@@ -27,7 +27,7 @@
   */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: getvfsquota.c,v 1.7 2011/06/07 14:56:13 bouyer Exp $");
+__RCSID("$NetBSD: getvfsquota.c,v 1.8 2011/09/30 22:08:19 jym Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -85,14 +85,14 @@ getvfsquota(const char *mp, struct ufs_q
 		printf("message to kernel:\n%s\n",
 		    prop_dictionary_externalize(dict));
 
-	if (!prop_dictionary_send_syscall(dict, &pref))
+	if (prop_dictionary_send_syscall(dict, &pref) != 0)
 		err(1, "prop_dictionary_send_syscall");
 	prop_object_release(dict);
 
 	if (quotactl(mp, &pref) != 0)
 		err(1, "quotactl");
 	
-	if ((errno = prop_dictionary_recv_syscall(&pref, &dict)) != 0)
+	if (prop_dictionary_recv_syscall(&pref, &dict) != 0)
 		err(1, "prop_dictionary_recv_syscall");
 	if (debug)
 		printf("reply from kernel:\n%s\n",

Index: src/usr.sbin/edquota/edquota.c
diff -u src/usr.sbin/edquota/edquota.c:1.35 src/usr.sbin/edquota/edquota.c:1.36
--- src/usr.sbin/edquota/edquota.c:1.35	Sun Jul 10 07:54:49 2011
+++ src/usr.sbin/edquota/edquota.c	Fri Sep 30 22:08:19 2011
@@ -1,4 +1,4 @@
-/*      $NetBSD: edquota.c,v 1.35 2011/07/10 07:54:49 dholland Exp $ */
+/*      $NetBSD: edquota.c,v 1.36 2011/09/30 22:08:19 jym Exp $ */
 /*
  * Copyright (c) 1980, 1990, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -41,7 +41,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "from: @(#)edquota.c	8.3 (Berkeley) 4/27/95";
 #else
-__RCSID("$NetBSD: edquota.c,v 1.35 2011/07/10 07:54:49 dholland Exp $");
+__RCSID("$NetBSD: edquota.c,v 1.36 2011/09/30 22:08:19 jym Exp $");
 #endif
 #endif /* not lint */
 
@@ -341,14 +341,14 @@ putprivs2(uint32_t id, int quotaclass, s
 		printf("message to kernel:\n%s\n",
 		    prop_dictionary_externalize(dict));
 
-	if (!prop_dictionary_send_syscall(dict, &pref))
+	if (prop_dictionary_send_syscall(dict, &pref) != 0)
 		err(1, "prop_dictionary_send_syscall");
 	prop_object_release(dict);
 
 	if (quotactl(qup->fsname, &pref) != 0)
 		err(1, "quotactl");
 
-	if ((errno = prop_dictionary_recv_syscall(&pref, &dict)) != 0) {
+	if (prop_dictionary_recv_syscall(&pref, &dict) != 0) {
 		err(1, "prop_dictionary_recv_syscall");
 	}
 
@@ -504,12 +504,12 @@ clearpriv(int argc, char **argv, const c
 			    prop_dictionary_externalize(protodict));
 		}
 
-		if (!prop_dictionary_send_syscall(protodict, &pref))
+		if (prop_dictionary_send_syscall(protodict, &pref) != 0)
 			err(1, "prop_dictionary_send_syscall");
 		if (quotactl(fst[i].f_mntonname, &pref) != 0)
 			err(1, "quotactl");
 
-		if ((errno = prop_dictionary_recv_syscall(&pref, &dict)) != 0) {
+		if (prop_dictionary_recv_syscall(&pref, &dict) != 0) {
 			err(1, "prop_dictionary_recv_syscall");
 		}
 

Index: src/usr.sbin/quotaon/quotaon.c
diff -u src/usr.sbin/quotaon/quotaon.c:1.26 src/usr.sbin/quotaon/quotaon.c:1.27
--- src/usr.sbin/quotaon/quotaon.c:1.26	Thu Mar 24 17:05:47 2011
+++ src/usr.sbin/quotaon/quotaon.c	Fri Sep 30 22:08:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: quotaon.c,v 1.26 2011/03/24 17:05:47 bouyer Exp $	*/
+/*	$NetBSD: quotaon.c,v 1.27 2011/09/30 22:08:20 jym Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)quotaon.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: quotaon.c,v 1.26 2011/03/24 17:05:47 bouyer Exp $");
+__RCSID("$NetBSD: quotaon.c,v 1.27 2011/09/30 22:08:20 jym Exp $");
 #endif
 #endif /* not lint */
 
@@ -197,7 +197,7 @@ quotaonoff( struct fstab *fs, int offmod
 	if (!prop_dictionary_set(dict, "commands", cmds))
 		err(1, "prop_dictionary_set(command)");
 
-	if (!prop_dictionary_send_syscall(dict, &pref))
+	if (prop_dictionary_send_syscall(dict, &pref) != 0)
 		err(1, "prop_dictionary_send_syscall");
 	prop_object_release(dict);
 
@@ -206,7 +206,7 @@ quotaonoff( struct fstab *fs, int offmod
 		return(1);
 	}
 
-	if ((errno = prop_dictionary_recv_syscall(&pref, &dict)) != 0)
+	if (prop_dictionary_recv_syscall(&pref, &dict) != 0)
 		err(1, "prop_dictionary_recv_syscall");
 
 	if ((errno = quota_get_cmds(dict, &cmds)) != 0)

Index: src/usr.sbin/repquota/repquota.c
diff -u src/usr.sbin/repquota/repquota.c:1.31 src/usr.sbin/repquota/repquota.c:1.32
--- src/usr.sbin/repquota/repquota.c:1.31	Sun Mar 27 17:15:17 2011
+++ src/usr.sbin/repquota/repquota.c	Fri Sep 30 22:08:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: repquota.c,v 1.31 2011/03/27 17:15:17 bouyer Exp $	*/
+/*	$NetBSD: repquota.c,v 1.32 2011/09/30 22:08:20 jym Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)repquota.c	8.2 (Berkeley) 11/22/94";
 #else
-__RCSID("$NetBSD: repquota.c,v 1.31 2011/03/27 17:15:17 bouyer Exp $");
+__RCSID("$NetBSD: repquota.c,v 1.32 2011/09/30 22:08:20 jym Exp $");
 #endif
 #endif /* not lint */
 
@@ -229,14 +229,14 @@ repquota2(const struct statvfs *vfs, int
 	if (Dflag)
 		printf("message to kernel:\n%s\n",
 		    prop_dictionary_externalize(dict));
-	if (!prop_dictionary_send_syscall(dict, &pref))
+	if (prop_dictionary_send_syscall(dict, &pref) != 0)
 		err(1, "prop_dictionary_send_syscall");
 	prop_object_release(dict);
 
 	if (quotactl(vfs->f_mntonname, &pref) != 0)
 		err(1, "quotactl");
 
-	if ((errno = prop_dictionary_recv_syscall(&pref, &dict)) != 0) {
+	if (prop_dictionary_recv_syscall(&pref, &dict) != 0) {
 		err(1, "prop_dictionary_recv_syscall");
 	}
 	if (Dflag)

Reply via email to