Thu Apr 18 15:59:59 2024 UTC (21d)
Pull up following revision(s) (requested by riastradh in ticket #1831):

	external/bsd/am-utils/dist/include/amq_defs.h: revision 1.2
	external/bsd/am-utils/dist/amq/amq_xdr.c: revision 1.2
	external/bsd/am-utils/dist/amq/amq.c: revision 1.4
	external/bsd/am-utils/dist/amd/amq_subr.c: revision 1.4
	external/bsd/am-utils/dist/amd/amq_subr.c: revision 1.5

fix pointer bug (thanks RVP) and change to use 64 bit times. Don't bother
with backwards compatibility; too much work for little benefit.

remove long cast (thanks RVP)


(martin)
diff -r1.3 -r1.3.18.1 src/external/bsd/am-utils/dist/amd/amq_subr.c
diff -r1.3 -r1.3.18.1 src/external/bsd/am-utils/dist/amq/amq.c
diff -r1.1.1.3 -r1.1.1.3.18.1 src/external/bsd/am-utils/dist/amq/amq_xdr.c
diff -r1.1.1.3 -r1.1.1.3.18.1 src/external/bsd/am-utils/dist/include/amq_defs.h

cvs diff -r1.3 -r1.3.18.1 src/external/bsd/am-utils/dist/amd/amq_subr.c (expand / switch to unified diff)

--- src/external/bsd/am-utils/dist/amd/amq_subr.c 2015/01/18 16:27:36 1.3
+++ src/external/bsd/am-utils/dist/amd/amq_subr.c 2024/04/18 15:59:59 1.3.18.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: amq_subr.c,v 1.3 2015/01/18 16:27:36 christos Exp $ */ 1/* $NetBSD: amq_subr.c,v 1.3.18.1 2024/04/18 15:59:59 martin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997-2014 Erez Zadok 4 * Copyright (c) 1997-2014 Erez Zadok
5 * Copyright (c) 1990 Jan-Simon Pendry 5 * Copyright (c) 1990 Jan-Simon Pendry
6 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine 6 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
7 * Copyright (c) 1990 The Regents of the University of California. 7 * Copyright (c) 1990 The Regents of the University of California.
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * This code is derived from software contributed to Berkeley by 10 * This code is derived from software contributed to Berkeley by
11 * Jan-Simon Pendry at Imperial College, London. 11 * Jan-Simon Pendry at Imperial College, London.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions 14 * modification, are permitted provided that the following conditions
@@ -321,42 +321,42 @@ xdr_amq_setopt(XDR *xdrs, amq_setopt *ob @@ -321,42 +321,42 @@ xdr_amq_setopt(XDR *xdrs, amq_setopt *ob
321 return (FALSE); 321 return (FALSE);
322 } 322 }
323 return (TRUE); 323 return (TRUE);
324} 324}
325 325
326 326
327/* 327/*
328 * More XDR routines - Should be used for OUTPUT ONLY. 328 * More XDR routines - Should be used for OUTPUT ONLY.
329 */ 329 */
330bool_t 330bool_t
331xdr_amq_mount_tree_node(XDR *xdrs, amq_mount_tree *objp) 331xdr_amq_mount_tree_node(XDR *xdrs, amq_mount_tree *objp)
332{ 332{
333 am_node *mp = (am_node *) objp; 333 am_node *mp = (am_node *) objp;
334 long mtime; 334 longlong_t mtime;
335 335
336 if (!xdr_amq_string(xdrs, &mp->am_al->al_mnt->mf_info)) { 336 if (!xdr_amq_string(xdrs, &mp->am_al->al_mnt->mf_info)) {
337 return (FALSE); 337 return (FALSE);
338 } 338 }
339 if (!xdr_amq_string(xdrs, &mp->am_path)) { 339 if (!xdr_amq_string(xdrs, &mp->am_path)) {
340 return (FALSE); 340 return (FALSE);
341 } 341 }
342 if (!xdr_amq_string(xdrs, mp->am_link ? &mp->am_link : &mp->am_al->al_mnt->mf_mount)) { 342 if (!xdr_amq_string(xdrs, mp->am_link ? &mp->am_link : &mp->am_al->al_mnt->mf_mount)) {
343 return (FALSE); 343 return (FALSE);
344 } 344 }
345 if (!xdr_amq_string(xdrs, &mp->am_al->al_mnt->mf_ops->fs_type)) { 345 if (!xdr_amq_string(xdrs, &mp->am_al->al_mnt->mf_ops->fs_type)) {
346 return (FALSE); 346 return (FALSE);
347 } 347 }
348 mtime = mp->am_stats.s_mtime; 348 mtime = mp->am_stats.s_mtime;
349 if (!xdr_long(xdrs, &mtime)) { 349 if (!xdr_longlong_t(xdrs, &mtime)) {
350 return (FALSE); 350 return (FALSE);
351 } 351 }
352 if (!xdr_u_short(xdrs, &mp->am_stats.s_uid)) { 352 if (!xdr_u_short(xdrs, &mp->am_stats.s_uid)) {
353 return (FALSE); 353 return (FALSE);
354 } 354 }
355 if (!xdr_int(xdrs, &mp->am_stats.s_getattr)) { 355 if (!xdr_int(xdrs, &mp->am_stats.s_getattr)) {
356 return (FALSE); 356 return (FALSE);
357 } 357 }
358 if (!xdr_int(xdrs, &mp->am_stats.s_lookup)) { 358 if (!xdr_int(xdrs, &mp->am_stats.s_lookup)) {
359 return (FALSE); 359 return (FALSE);
360 } 360 }
361 if (!xdr_int(xdrs, &mp->am_stats.s_readdir)) { 361 if (!xdr_int(xdrs, &mp->am_stats.s_readdir)) {
362 return (FALSE); 362 return (FALSE);
@@ -520,53 +520,53 @@ xdr_amq_mount_info_qelem(XDR *xdrs, qele @@ -520,53 +520,53 @@ xdr_amq_mount_info_qelem(XDR *xdrs, qele
520 return (FALSE); 520 return (FALSE);
521 } 521 }
522 } 522 }
523 return (TRUE); 523 return (TRUE);
524} 524}
525 525
526bool_t 526bool_t
527xdr_amq_map_info_qelem(XDR *xdrs, qelem *qhead) 527xdr_amq_map_info_qelem(XDR *xdrs, qelem *qhead)
528{ 528{
529 mnt_map *m; 529 mnt_map *m;
530 u_int len = 0; 530 u_int len = 0;
531 int x; 531 int x;
532 char *n; 532 char *n;
533 long modify; 533 longlong_t modify;
534 534
535 /* 535 /*
536 * Compute length of list 536 * Compute length of list
537 */ 537 */
538 ITER(m, mnt_map, qhead) { 538 ITER(m, mnt_map, qhead) {
539 len++; 539 len++;
540 } 540 }
541 541
542 if (!xdr_u_int(xdrs, &len)) 542 if (!xdr_u_int(xdrs, &len))
543 return (FALSE); 543 return (FALSE);
544 544
545 /* 545 /*
546 * Send individual data items 546 * Send individual data items
547 */ 547 */
548 ITER(m, mnt_map, qhead) { 548 ITER(m, mnt_map, qhead) {
549 if (!xdr_amq_string(xdrs, &m->map_name)) { 549 if (!xdr_amq_string(xdrs, &m->map_name)) {
550 return (FALSE); 550 return (FALSE);
551 } 551 }
552 552
553 n = m->wildcard ? m->wildcard : ""; 553 n = m->wildcard ? m->wildcard : "";
554 if (!xdr_amq_string(xdrs, &n)) { 554 if (!xdr_amq_string(xdrs, &n)) {
555 return (FALSE); 555 return (FALSE);
556 } 556 }
557 557
558 modify = (long)m->modify; 558 modify = m->modify;
559 if (!xdr_long(xdrs, &modify)) { 559 if (!xdr_longlong_t(xdrs, &modify)) {
560 return (FALSE); 560 return (FALSE);
561 } 561 }
562 562
563 x = m->flags; 563 x = m->flags;
564 if (!xdr_int(xdrs, &x)) { 564 if (!xdr_int(xdrs, &x)) {
565 return (FALSE); 565 return (FALSE);
566 } 566 }
567 567
568 x = m->nentries; 568 x = m->nentries;
569 if (!xdr_int(xdrs, &x)) { 569 if (!xdr_int(xdrs, &x)) {
570 return (FALSE); 570 return (FALSE);
571 } 571 }
572 572

cvs diff -r1.3 -r1.3.18.1 src/external/bsd/am-utils/dist/amq/amq.c (expand / switch to unified diff)

--- src/external/bsd/am-utils/dist/amq/amq.c 2015/01/18 15:37:57 1.3
+++ src/external/bsd/am-utils/dist/amq/amq.c 2024/04/18 15:59:59 1.3.18.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: amq.c,v 1.3 2015/01/18 15:37:57 christos Exp $ */ 1/* $NetBSD: amq.c,v 1.3.18.1 2024/04/18 15:59:59 martin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997-2014 Erez Zadok 4 * Copyright (c) 1997-2014 Erez Zadok
5 * Copyright (c) 1990 Jan-Simon Pendry 5 * Copyright (c) 1990 Jan-Simon Pendry
6 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine 6 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
7 * Copyright (c) 1990 The Regents of the University of California. 7 * Copyright (c) 1990 The Regents of the University of California.
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * This code is derived from software contributed to Berkeley by 10 * This code is derived from software contributed to Berkeley by
11 * Jan-Simon Pendry at Imperial College, London. 11 * Jan-Simon Pendry at Imperial College, London.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions 14 * modification, are permitted provided that the following conditions
@@ -71,27 +71,27 @@ static char *def_server = localhost; @@ -71,27 +71,27 @@ static char *def_server = localhost;
71/* externals */ 71/* externals */
72extern int optind; 72extern int optind;
73extern char *optarg; 73extern char *optarg;
74 74
75/* structures */ 75/* structures */
76enum show_opt { 76enum show_opt {
77 Full, Stats, Calc, Short, ShowDone 77 Full, Stats, Calc, Short, ShowDone
78}; 78};
79 79
80 80
81static void 81static void
82time_print(time_type tt) 82time_print(time_type tt)
83{ 83{
84 time_t t = (time_t)*tt; 84 time_t t = (time_t)tt;
85 struct tm *tp = localtime(&t); 85 struct tm *tp = localtime(&t);
86 printf("%02d/%02d/%04d %02d:%02d:%02d", 86 printf("%02d/%02d/%04d %02d:%02d:%02d",
87 tp->tm_mon + 1, tp->tm_mday, 87 tp->tm_mon + 1, tp->tm_mday,
88 tp->tm_year < 1900 ? tp->tm_year + 1900 : tp->tm_year, 88 tp->tm_year < 1900 ? tp->tm_year + 1900 : tp->tm_year,
89 tp->tm_hour, tp->tm_min, tp->tm_sec); 89 tp->tm_hour, tp->tm_min, tp->tm_sec);
90} 90}
91 91
92/* 92/*
93 * If (e) is Calc then just calculate the sizes 93 * If (e) is Calc then just calculate the sizes
94 * Otherwise display the mount node on stdout 94 * Otherwise display the mount node on stdout
95 */ 95 */
96static void 96static void
97show_mti(amq_mount_tree *mt, enum show_opt e, int *mwid, int *dwid, int *twid) 97show_mti(amq_mount_tree *mt, enum show_opt e, int *mwid, int *dwid, int *twid)

cvs diff -r1.1.1.3 -r1.1.1.3.18.1 src/external/bsd/am-utils/dist/amq/amq_xdr.c (expand / switch to unified diff)

--- src/external/bsd/am-utils/dist/amq/amq_xdr.c 2015/01/17 16:34:15 1.1.1.3
+++ src/external/bsd/am-utils/dist/amq/amq_xdr.c 2024/04/18 15:59:59 1.1.1.3.18.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: amq_xdr.c,v 1.1.1.3 2015/01/17 16:34:15 christos Exp $ */ 1/* $NetBSD: amq_xdr.c,v 1.1.1.3.18.1 2024/04/18 15:59:59 martin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997-2014 Erez Zadok 4 * Copyright (c) 1997-2014 Erez Zadok
5 * Copyright (c) 1990 Jan-Simon Pendry 5 * Copyright (c) 1990 Jan-Simon Pendry
6 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine 6 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
7 * Copyright (c) 1990 The Regents of the University of California. 7 * Copyright (c) 1990 The Regents of the University of California.
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * This code is derived from software contributed to Berkeley by 10 * This code is derived from software contributed to Berkeley by
11 * Jan-Simon Pendry at Imperial College, London. 11 * Jan-Simon Pendry at Imperial College, London.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions 14 * modification, are permitted provided that the following conditions
@@ -39,27 +39,27 @@ @@ -39,27 +39,27 @@
39 * 39 *
40 */ 40 */
41 41
42#ifdef HAVE_CONFIG_H 42#ifdef HAVE_CONFIG_H
43# include <config.h> 43# include <config.h>
44#endif /* HAVE_CONFIG_H */ 44#endif /* HAVE_CONFIG_H */
45#include <am_defs.h> 45#include <am_defs.h>
46#include <amq.h> 46#include <amq.h>
47 47
48 48
49bool_t 49bool_t
50xdr_time_type(XDR *xdrs, time_type *objp) 50xdr_time_type(XDR *xdrs, time_type *objp)
51{ 51{
52 if (!xdr_long(xdrs, (long *) objp)) { 52 if (!xdr_longlong_t(xdrs, (longlong_t *) objp)) {
53 return (FALSE); 53 return (FALSE);
54 } 54 }
55 return (TRUE); 55 return (TRUE);
56} 56}
57 57
58 58
59bool_t 59bool_t
60xdr_amq_mount_tree(XDR *xdrs, amq_mount_tree *objp) 60xdr_amq_mount_tree(XDR *xdrs, amq_mount_tree *objp)
61{ 61{
62 62
63 if (!xdr_amq_string(xdrs, &objp->mt_mountinfo)) { 63 if (!xdr_amq_string(xdrs, &objp->mt_mountinfo)) {
64 return (FALSE); 64 return (FALSE);
65 } 65 }

cvs diff -r1.1.1.3 -r1.1.1.3.18.1 src/external/bsd/am-utils/dist/include/amq_defs.h (expand / switch to unified diff)

--- src/external/bsd/am-utils/dist/include/amq_defs.h 2015/01/17 16:34:18 1.1.1.3
+++ src/external/bsd/am-utils/dist/include/amq_defs.h 2024/04/18 15:59:59 1.1.1.3.18.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: amq_defs.h,v 1.1.1.3 2015/01/17 16:34:18 christos Exp $ */ 1/* $NetBSD: amq_defs.h,v 1.1.1.3.18.1 2024/04/18 15:59:59 martin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997-2014 Erez Zadok 4 * Copyright (c) 1997-2014 Erez Zadok
5 * Copyright (c) 1990 Jan-Simon Pendry 5 * Copyright (c) 1990 Jan-Simon Pendry
6 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine 6 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
7 * Copyright (c) 1990 The Regents of the University of California. 7 * Copyright (c) 1990 The Regents of the University of California.
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * This code is derived from software contributed to Berkeley by 10 * This code is derived from software contributed to Berkeley by
11 * Jan-Simon Pendry at Imperial College, London. 11 * Jan-Simon Pendry at Imperial College, London.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions 14 * modification, are permitted provided that the following conditions
@@ -58,27 +58,27 @@ @@ -58,27 +58,27 @@
58#define AMQPROC_EXPORT ((u_long)4) 58#define AMQPROC_EXPORT ((u_long)4)
59#define AMQPROC_SETOPT ((u_long)5) 59#define AMQPROC_SETOPT ((u_long)5)
60#define AMQPROC_GETMNTFS ((u_long)6) 60#define AMQPROC_GETMNTFS ((u_long)6)
61#define AMQPROC_MOUNT ((u_long)7) 61#define AMQPROC_MOUNT ((u_long)7)
62#define AMQPROC_GETVERS ((u_long)8) 62#define AMQPROC_GETVERS ((u_long)8)
63#define AMQPROC_GETPID ((u_long)9) 63#define AMQPROC_GETPID ((u_long)9)
64#define AMQPROC_PAWD ((u_long)10) 64#define AMQPROC_PAWD ((u_long)10)
65#define AMQPROC_SYNC_UMNT ((u_long)11) /* synchronous unmount */ 65#define AMQPROC_SYNC_UMNT ((u_long)11) /* synchronous unmount */
66#define AMQPROC_GETMAPINFO ((u_long)12) 66#define AMQPROC_GETMAPINFO ((u_long)12)
67 67
68/* 68/*
69 * TYPEDEFS 69 * TYPEDEFS
70 */ 70 */
71typedef long *time_type; 71typedef long long time_type;
72typedef struct amq_mount_info amq_mount_info; 72typedef struct amq_mount_info amq_mount_info;
73typedef struct amq_map_info amq_map_info; 73typedef struct amq_map_info amq_map_info;
74typedef struct amq_mount_stats amq_mount_stats; 74typedef struct amq_mount_stats amq_mount_stats;
75typedef struct amq_mount_tree amq_mount_tree; 75typedef struct amq_mount_tree amq_mount_tree;
76typedef struct amq_setopt amq_setopt; 76typedef struct amq_setopt amq_setopt;
77typedef struct amq_sync_umnt amq_sync_umnt; 77typedef struct amq_sync_umnt amq_sync_umnt;
78typedef amq_mount_tree *amq_mount_tree_p; 78typedef amq_mount_tree *amq_mount_tree_p;
79 79
80/* 80/*
81 * STRUCTURES: 81 * STRUCTURES:
82 */ 82 */
83struct amq_mount_tree { 83struct amq_mount_tree {
84 amq_string mt_mountinfo; 84 amq_string mt_mountinfo;