Print this page
5910 libnisdb won't build with modern GCC
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libnisdb/db_dictxdr.c
+++ new/usr/src/lib/libnisdb/db_dictxdr.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * db_dictxdr.c
24 24 *
25 + * Copyright 2015 Gary Mills
25 26 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
26 27 * Use is subject to license terms.
27 28 */
28 29
29 -#pragma ident "%Z%%M% %I% %E% SMI"
30 -
31 30 #include "db_dictionary_c.h"
31 +#include "db_dictionary.h"
32 32 #include "db_vers_c.h"
33 33
34 34 extern vers db_update_version;
35 35
36 36 extern void make_zero(vers*);
37 37
38 38 /* Special xdr_db_dict_desc that understands optional version number at end. */
39 39 bool_t
40 40 xdr_db_dict_desc(XDR *xdrs, db_dict_desc *objp)
41 41 {
42 42
43 43 if (!xdr_db_dict_version(xdrs, &objp->impl_vers))
44 44 return (FALSE);
45 45 if (!xdr_array(xdrs, (char **)&objp->tables.tables_val,
46 46 (uint_t *)&objp->tables.tables_len, ~0,
47 47 sizeof (db_table_desc_p), (xdrproc_t)xdr_db_table_desc_p))
48 48 return (FALSE);
49 49 if (!xdr_int(xdrs, &objp->count))
50 50 return (FALSE);
51 51
52 52 if (xdrs->x_op == XDR_DECODE) {
53 53 /* If no version was found, set version to 0. */
54 54 if (!xdr_vers(xdrs, (void**) &db_update_version))
55 55 make_zero(&db_update_version);
56 56 return (TRUE);
57 57 } else if (xdrs->x_op == XDR_ENCODE) {
58 58 /* Always write out version */
59 59 if (!xdr_vers(xdrs, (void**) &db_update_version))
60 60 return (FALSE);
61 61 } /* else XDR_FREE: do nothing */
62 62
63 63 return (TRUE);
64 64 }
↓ open down ↓ |
23 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX