diff options
author | grant <grant> | 2004-03-11 13:45:55 +0000 |
---|---|---|
committer | grant <grant> | 2004-03-11 13:45:55 +0000 |
commit | 05ddbf6b3dfa6c15750f49b35a54372b81e2328c (patch) | |
tree | 1f6bb08672fa4101131dc470471294007db7fedc /net | |
parent | 9cca0b33f0a6a1b944c23a158c2b17102e8b49db (diff) | |
download | pkgsrc-05ddbf6b3dfa6c15750f49b35a54372b81e2328c.tar.gz |
catch up with bootstrap-pkgsrc changes.
Add a utimes() stub for Interix.
(this change also needs to go in othersrc/usr.bin/tnftp)
Diffstat (limited to 'net')
-rw-r--r-- | net/tnftp/files/config.h.in | 5 | ||||
-rwxr-xr-x | net/tnftp/files/configure | 4 | ||||
-rw-r--r-- | net/tnftp/files/configure.in | 6 | ||||
-rw-r--r-- | net/tnftp/files/tnftp.h | 6 | ||||
-rw-r--r-- | net/tnftp/files/utimes.c | 59 |
5 files changed, 73 insertions, 7 deletions
diff --git a/net/tnftp/files/config.h.in b/net/tnftp/files/config.h.in index fcb574887bd..178fa132ee7 100644 --- a/net/tnftp/files/config.h.in +++ b/net/tnftp/files/config.h.in @@ -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 --git a/net/tnftp/files/configure b/net/tnftp/files/configure index 5154cf190cf..0060d9ede8c 100755 --- a/net/tnftp/files/configure +++ b/net/tnftp/files/configure @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in Revision: 1.5 +# From configure.in Revision: 1.1.1.1 @@ -3236,7 +3236,7 @@ EOF 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 --git a/net/tnftp/files/configure.in b/net/tnftp/files/configure.in index 7887ce357fb..8263050e151 100644 --- a/net/tnftp/files/configure.in +++ b/net/tnftp/files/configure.in @@ -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 Checks for library functions. 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 --git a/net/tnftp/files/tnftp.h b/net/tnftp/files/tnftp.h index bb36e716102..162744a1ddf 100644 --- a/net/tnftp/files/tnftp.h +++ b/net/tnftp/files/tnftp.h @@ -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 @@ size_t strlcpy(char *, const char *, size_t); 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 --git a/net/tnftp/files/utimes.c b/net/tnftp/files/utimes.c new file mode 100644 index 00000000000..79fff58a7ec --- /dev/null +++ b/net/tnftp/files/utimes.c @@ -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)); +} |