fetch.c (106796) | fetch.c (106857) |
---|---|
1/*- 2 * Copyright (c) 2000 Dag-Erling Co�dan Sm�rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2000 Dag-Erling Co�dan Sm�rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/usr.bin/fetch/fetch.c 106796 2002-11-12 07:09:43Z fenner $"); | 30__FBSDID("$FreeBSD: head/usr.bin/fetch/fetch.c 106857 2002-11-13 16:04:20Z des $"); |
31 32#include <sys/param.h> 33#include <sys/socket.h> 34#include <sys/stat.h> 35#include <sys/time.h> 36 37#include <ctype.h> 38#include <err.h> --- 528 unchanged lines hidden (view full) --- 567 568 /* 569 * If the transfer timed out or was interrupted, we still want to 570 * set the mtime in case the file is not removed (-r or -R) and 571 * the user later restarts the transfer. 572 */ 573 signal: 574 /* set mtime of local file */ | 31 32#include <sys/param.h> 33#include <sys/socket.h> 34#include <sys/stat.h> 35#include <sys/time.h> 36 37#include <ctype.h> 38#include <err.h> --- 528 unchanged lines hidden (view full) --- 567 568 /* 569 * If the transfer timed out or was interrupted, we still want to 570 * set the mtime in case the file is not removed (-r or -R) and 571 * the user later restarts the transfer. 572 */ 573 signal: 574 /* set mtime of local file */ |
575 if (!n_flag && us.mtime && !o_stdout 576 && (stat(path, &sb) != -1) && sb.st_mode & S_IFREG) { | 575 if (!n_flag && us.mtime && !o_stdout && of != NULL && 576 (stat(path, &sb) != -1) && sb.st_mode & S_IFREG) { |
577 struct timeval tv[2]; 578 579 fflush(of); 580 tv[0].tv_sec = (long)(us.atime ? us.atime : us.mtime); 581 tv[1].tv_sec = (long)us.mtime; 582 tv[0].tv_usec = tv[1].tv_usec = 0; 583 if (utimes(tmppath ? tmppath : path, tv)) 584 warn("%s: utimes()", tmppath ? tmppath : path); --- 339 unchanged lines hidden --- | 577 struct timeval tv[2]; 578 579 fflush(of); 580 tv[0].tv_sec = (long)(us.atime ? us.atime : us.mtime); 581 tv[1].tv_sec = (long)us.mtime; 582 tv[0].tv_usec = tv[1].tv_usec = 0; 583 if (utimes(tmppath ? tmppath : path, tv)) 584 warn("%s: utimes()", tmppath ? tmppath : path); --- 339 unchanged lines hidden --- |