pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/tnftp/files catch up with bootstrap-pkgsrc changes.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2a62d1b10d72
branches:  trunk
changeset: 470693:2a62d1b10d72
user:      grant <grant%pkgsrc.org@localhost>
date:      Thu Mar 11 13:45:55 2004 +0000

description:
catch up with bootstrap-pkgsrc changes.

Add a utimes() stub for Interix.

(this change also needs to go in othersrc/usr.bin/tnftp)

diffstat:

 net/tnftp/files/config.h.in  |   5 ++-
 net/tnftp/files/configure    |   4 +-
 net/tnftp/files/configure.in |   6 ++--
 net/tnftp/files/tnftp.h      |   6 +++-
 net/tnftp/files/utimes.c     |  59 ++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 73 insertions(+), 7 deletions(-)

diffs (148 lines):

diff -r f5b9fcc5ad92 -r 2a62d1b10d72 net/tnftp/files/config.h.in
--- a/net/tnftp/files/config.h.in       Thu Mar 11 13:33:57 2004 +0000
+++ b/net/tnftp/files/config.h.in       Thu Mar 11 13:45:55 2004 +0000
@@ -1,5 +1,5 @@
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
-/* $Id: config.h.in,v 1.1 2004/03/11 13:01:01 grant Exp $ */
+/* $Id: config.h.in,v 1.2 2004/03/11 13:45:55 grant Exp $ */
 
 
 /* Define if on AIX 3.
@@ -132,6 +132,9 @@
 /* Define if you have the usleep function.  */
 #undef HAVE_USLEEP
 
+/* Define if you have the utimes function.  */
+#undef HAVE_UTIMES
+
 /* Define if you have the <arpa/nameser.h> header file.  */
 #undef HAVE_ARPA_NAMESER_H
 
diff -r f5b9fcc5ad92 -r 2a62d1b10d72 net/tnftp/files/configure
--- a/net/tnftp/files/configure Thu Mar 11 13:33:57 2004 +0000
+++ b/net/tnftp/files/configure Thu Mar 11 13:45:55 2004 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# From configure.in Revision: 1.5 
+# From configure.in Revision: 1.1.1.1 
 
 
 
@@ -3236,7 +3236,7 @@
 
 for ac_func in err fgetln fseeko getaddrinfo getnameinfo inet_ntop inet_pton \
                mkstemp setprogname sl_init snprintf strdup strerror strlcat \
-               strlcpy strptime strsep strunvis strvis timegm usleep
+               strlcpy strptime strsep strunvis strvis timegm usleep utimes
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
 echo "configure:3243: checking for $ac_func" >&5
diff -r f5b9fcc5ad92 -r 2a62d1b10d72 net/tnftp/files/configure.in
--- a/net/tnftp/files/configure.in      Thu Mar 11 13:33:57 2004 +0000
+++ b/net/tnftp/files/configure.in      Thu Mar 11 13:45:55 2004 +0000
@@ -1,10 +1,10 @@
-dnl $Id: configure.in,v 1.1 2004/03/11 13:01:01 grant Exp $
+dnl $Id: configure.in,v 1.2 2004/03/11 13:45:55 grant Exp $
 dnl
 dnl configure.in --
 dnl    process this file with autoconf to produce a configure script.
 dnl
 
-AC_REVISION($Revision: 1.1 $)dnl
+AC_REVISION($Revision: 1.2 $)dnl
 
 AC_INIT(tnftp.h)
 
@@ -168,7 +168,7 @@
 dnl
 AC_REPLACE_FUNCS(err fgetln fseeko getaddrinfo getnameinfo inet_ntop inet_pton \
                mkstemp setprogname sl_init snprintf strdup strerror strlcat \
-               strlcpy strptime strsep strunvis strvis timegm usleep)
+               strlcpy strptime strsep strunvis strvis timegm usleep utimes)
 AC_CHECK_FUNCS(gethostbyname2 getpassphrase getpgrp memmove poll select)
 if test $ac_cv_func_getpgrp = yes; then
        AC_FUNC_GETPGRP
diff -r f5b9fcc5ad92 -r 2a62d1b10d72 net/tnftp/files/tnftp.h
--- a/net/tnftp/files/tnftp.h   Thu Mar 11 13:33:57 2004 +0000
+++ b/net/tnftp/files/tnftp.h   Thu Mar 11 13:45:55 2004 +0000
@@ -1,4 +1,4 @@
-/* $Id: tnftp.h,v 1.1 2004/03/11 13:01:01 grant Exp $ */
+/* $Id: tnftp.h,v 1.2 2004/03/11 13:45:55 grant Exp $ */
 
 #define        FTP_PRODUCT     "tnftp"
 #define        FTP_VERSION     "20030825"
@@ -369,6 +369,10 @@
 char   *strsep(char **stringp, const char *delim);
 #endif
 
+#if ! HAVE_UTIMES
+int utimes(const char *, const struct timeval *);
+#endif
+
 #if ! HAVE_MEMMOVE
 # define memmove(a,b,c)        bcopy((b),(a),(c))
        /* XXX: add others #defines for borken systems? */
diff -r f5b9fcc5ad92 -r 2a62d1b10d72 net/tnftp/files/utimes.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/tnftp/files/utimes.c  Thu Mar 11 13:45:55 2004 +0000
@@ -0,0 +1,59 @@
+/*     $NetBSD: utimes.c,v 1.1 2004/03/11 13:45:55 grant Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Your OS is old, eh?
+ * Emulate utimes(2) using utime(2), but losing sub-second granularity.
+ */
+
+#include "nbcompat.h"
+
+#include <unistd.h>
+#include <utime.h>
+
+int
+utimes(const char *path, const struct timeval *times)
+{
+       if (times != NULL) {
+               struct utimbuf ut;
+
+               ut.actime = times[0].tv_sec;
+               ut.modtime = times[1].tv_sec;
+
+               return (utime(path, &ut));
+       }
+
+       return (utime(path, NULL));
+}



Home | Main Index | Thread Index | Old Index