Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/am-utils/dist fix pointer bug (thanks RVP) and ...



details:   https://anonhg.NetBSD.org/src/rev/95e804b1cb14
branches:  trunk
changeset: 369608:95e804b1cb14
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Aug 23 07:42:28 2022 +0000

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

diffstat:

 external/bsd/am-utils/dist/amd/amq_subr.c     |  10 +++++-----
 external/bsd/am-utils/dist/amq/amq.c          |   4 ++--
 external/bsd/am-utils/dist/amq/amq_xdr.c      |   4 ++--
 external/bsd/am-utils/dist/include/amq_defs.h |   4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)

diffs (99 lines):

diff -r 129f60acfc2b -r 95e804b1cb14 external/bsd/am-utils/dist/amd/amq_subr.c
--- a/external/bsd/am-utils/dist/amd/amq_subr.c Tue Aug 23 05:41:46 2022 +0000
+++ b/external/bsd/am-utils/dist/amd/amq_subr.c Tue Aug 23 07:42:28 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amq_subr.c,v 1.3 2015/01/18 16:27:36 christos Exp $    */
+/*     $NetBSD: amq_subr.c,v 1.4 2022/08/23 07:42:28 christos Exp $    */
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -331,7 +331,7 @@
 xdr_amq_mount_tree_node(XDR *xdrs, amq_mount_tree *objp)
 {
   am_node *mp = (am_node *) objp;
-  long mtime;
+  longlong_t mtime;
 
   if (!xdr_amq_string(xdrs, &mp->am_al->al_mnt->mf_info)) {
     return (FALSE);
@@ -346,7 +346,7 @@
     return (FALSE);
   }
   mtime = mp->am_stats.s_mtime;
-  if (!xdr_long(xdrs, &mtime)) {
+  if (!xdr_longlong_t(xdrs, &mtime)) {
     return (FALSE);
   }
   if (!xdr_u_short(xdrs, &mp->am_stats.s_uid)) {
@@ -530,7 +530,7 @@
   u_int len = 0;
   int x;
   char *n;
-  long modify;
+  longlong_t modify;
 
   /*
    * Compute length of list
@@ -556,7 +556,7 @@
     }
 
     modify = (long)m->modify;
-    if (!xdr_long(xdrs, &modify)) {
+    if (!xdr_longlong_t(xdrs, &modify)) {
       return (FALSE);
     }
 
diff -r 129f60acfc2b -r 95e804b1cb14 external/bsd/am-utils/dist/amq/amq.c
--- a/external/bsd/am-utils/dist/amq/amq.c      Tue Aug 23 05:41:46 2022 +0000
+++ b/external/bsd/am-utils/dist/amq/amq.c      Tue Aug 23 07:42:28 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amq.c,v 1.3 2015/01/18 15:37:57 christos Exp $ */
+/*     $NetBSD: amq.c,v 1.4 2022/08/23 07:42:28 christos Exp $ */
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -81,7 +81,7 @@
 static void
 time_print(time_type tt)
 {
-  time_t t = (time_t)*tt;
+  time_t t = (time_t)tt;
   struct tm *tp = localtime(&t);
   printf("%02d/%02d/%04d %02d:%02d:%02d",
         tp->tm_mon + 1, tp->tm_mday,
diff -r 129f60acfc2b -r 95e804b1cb14 external/bsd/am-utils/dist/amq/amq_xdr.c
--- a/external/bsd/am-utils/dist/amq/amq_xdr.c  Tue Aug 23 05:41:46 2022 +0000
+++ b/external/bsd/am-utils/dist/amq/amq_xdr.c  Tue Aug 23 07:42:28 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amq_xdr.c,v 1.1.1.3 2015/01/17 16:34:15 christos Exp $ */
+/*     $NetBSD: amq_xdr.c,v 1.2 2022/08/23 07:42:28 christos Exp $     */
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -49,7 +49,7 @@
 bool_t
 xdr_time_type(XDR *xdrs, time_type *objp)
 {
-  if (!xdr_long(xdrs, (long *) objp)) {
+  if (!xdr_longlong_t(xdrs, (longlong_t *) objp)) {
     return (FALSE);
   }
   return (TRUE);
diff -r 129f60acfc2b -r 95e804b1cb14 external/bsd/am-utils/dist/include/amq_defs.h
--- a/external/bsd/am-utils/dist/include/amq_defs.h     Tue Aug 23 05:41:46 2022 +0000
+++ b/external/bsd/am-utils/dist/include/amq_defs.h     Tue Aug 23 07:42:28 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amq_defs.h,v 1.1.1.3 2015/01/17 16:34:18 christos Exp $        */
+/*     $NetBSD: amq_defs.h,v 1.2 2022/08/23 07:42:28 christos Exp $    */
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -68,7 +68,7 @@
 /*
  * TYPEDEFS
  */
-typedef long *time_type;
+typedef long long time_type;
 typedef struct amq_mount_info amq_mount_info;
 typedef struct amq_map_info amq_map_info;
 typedef struct amq_mount_stats amq_mount_stats;



Home | Main Index | Thread Index | Old Index