- stevesk@cvs.openbsd.org 2001/04/14 17:04:42
[scp.c] 'T' handling rcp/scp sync; ok markus@
This commit is contained in:
parent
ae8e2d30db
commit
f719a20110
|
@ -12,6 +12,9 @@
|
||||||
- stevesk@cvs.openbsd.org 2001/04/14 16:33:20
|
- stevesk@cvs.openbsd.org 2001/04/14 16:33:20
|
||||||
[clientloop.c packet.h session.c ssh.c ttymodes.c ttymodes.h]
|
[clientloop.c packet.h session.c ssh.c ttymodes.c ttymodes.h]
|
||||||
protocol 2 tty modes support; ok markus@
|
protocol 2 tty modes support; ok markus@
|
||||||
|
- stevesk@cvs.openbsd.org 2001/04/14 17:04:42
|
||||||
|
[scp.c]
|
||||||
|
'T' handling rcp/scp sync; ok markus@
|
||||||
|
|
||||||
20010414
|
20010414
|
||||||
- Sync with OpenBSD glob.c, strlcat.c and vis.c changes
|
- Sync with OpenBSD glob.c, strlcat.c and vis.c changes
|
||||||
|
@ -5078,4 +5081,4 @@
|
||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.1114 2001/04/14 23:13:02 mouring Exp $
|
$Id: ChangeLog,v 1.1115 2001/04/14 23:14:22 mouring Exp $
|
||||||
|
|
25
scp.c
25
scp.c
|
@ -75,7 +75,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: scp.c,v 1.65 2001/04/06 16:46:59 deraadt Exp $");
|
RCSID("$OpenBSD: scp.c,v 1.66 2001/04/14 17:04:42 stevesk Exp $");
|
||||||
|
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
#include "atomicio.h"
|
#include "atomicio.h"
|
||||||
|
@ -677,9 +677,10 @@ sink(argc, argv)
|
||||||
off_t size;
|
off_t size;
|
||||||
int setimes, targisdir, wrerrno = 0;
|
int setimes, targisdir, wrerrno = 0;
|
||||||
char ch, *cp, *np, *targ, *why, *vect[1], buf[2048];
|
char ch, *cp, *np, *targ, *why, *vect[1], buf[2048];
|
||||||
int dummy_usec;
|
|
||||||
struct timeval tv[2];
|
struct timeval tv[2];
|
||||||
|
|
||||||
|
#define atime tv[0]
|
||||||
|
#define mtime tv[1]
|
||||||
#define SCREWUP(str) { why = str; goto screwup; }
|
#define SCREWUP(str) { why = str; goto screwup; }
|
||||||
|
|
||||||
setimes = targisdir = 0;
|
setimes = targisdir = 0;
|
||||||
|
@ -726,25 +727,21 @@ sink(argc, argv)
|
||||||
if (ch == '\n')
|
if (ch == '\n')
|
||||||
*--cp = 0;
|
*--cp = 0;
|
||||||
|
|
||||||
#define getnum(t) (t) = 0; \
|
|
||||||
while (*cp >= '0' && *cp <= '9') (t) = (t) * 10 + (*cp++ - '0');
|
|
||||||
cp = buf;
|
cp = buf;
|
||||||
if (*cp == 'T') {
|
if (*cp == 'T') {
|
||||||
setimes++;
|
setimes++;
|
||||||
cp++;
|
cp++;
|
||||||
getnum(tv[1].tv_sec);
|
mtime.tv_sec = strtol(cp, &cp, 10);
|
||||||
if (*cp++ != ' ')
|
if (!cp || *cp++ != ' ')
|
||||||
SCREWUP("mtime.sec not delimited");
|
SCREWUP("mtime.sec not delimited");
|
||||||
getnum(dummy_usec);
|
mtime.tv_usec = strtol(cp, &cp, 10);
|
||||||
tv[1].tv_usec = 0;
|
if (!cp || *cp++ != ' ')
|
||||||
if (*cp++ != ' ')
|
|
||||||
SCREWUP("mtime.usec not delimited");
|
SCREWUP("mtime.usec not delimited");
|
||||||
getnum(tv[0].tv_sec);
|
atime.tv_sec = strtol(cp, &cp, 10);
|
||||||
if (*cp++ != ' ')
|
if (!cp || *cp++ != ' ')
|
||||||
SCREWUP("atime.sec not delimited");
|
SCREWUP("atime.sec not delimited");
|
||||||
getnum(dummy_usec);
|
atime.tv_usec = strtol(cp, &cp, 10);
|
||||||
tv[0].tv_usec = 0;
|
if (!cp || *cp++ != '\0')
|
||||||
if (*cp++ != '\0')
|
|
||||||
SCREWUP("atime.usec not delimited");
|
SCREWUP("atime.usec not delimited");
|
||||||
(void) atomicio(write, remout, "", 1);
|
(void) atomicio(write, remout, "", 1);
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue