]> andersk Git - openssh.git/blobdiff - scp.c
- deraadt@cvs.openbsd.org 2001/03/02 18:54:31
[openssh.git] / scp.c
diff --git a/scp.c b/scp.c
index 268643b518e098c1676c420e8153e4dbd179c090..c8bb2d3331e4de1debc5b337cdd3e9eb4e337918 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -14,8 +14,8 @@
  * called by a name other than "ssh" or "Secure Shell".
  */
 /*
- * Copyright (c) 1999 Theo de Raadt. All rights reserved.
- * Copyright (c) 1999 Aaron Campbell. All rights reserved.
+ * Copyright (c) 1999 Theo de Raadt.  All rights reserved.
+ * Copyright (c) 1999 Aaron Campbell.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.58 2001/02/10 15:14:11 danh Exp $");
+RCSID("$OpenBSD: scp.c,v 1.60 2001/03/02 18:54:31 deraadt Exp $");
 
 #include "xmalloc.h"
 #include "atomicio.h"
 #include "pathnames.h"
 #include "log.h"
+#include "misc.h"
 
 #ifdef HAVE___PROGNAME
 extern char *__progname;
@@ -801,16 +802,16 @@ sink(argc, argv)
                        }
                        vect[0] = xstrdup(np);
                        sink(1, vect);
-                       if (vect[0])
-                               xfree(vect[0]);
                        if (setimes) {
                                setimes = 0;
-                               if (utimes(np, tv) < 0)
+                               if (utimes(vect[0], tv) < 0)
                                        run_err("%s: set times: %s",
-                                               np, strerror(errno));
+                                           vect[0], strerror(errno));
                        }
                        if (mod_flag)
-                               (void) chmod(np, mode);
+                               (void) chmod(vect[0], mode);
+                       if (vect[0])
+                               xfree(vect[0]);
                        continue;
                }
                omode = mode;
@@ -1221,13 +1222,7 @@ progressmeter(int flag)
        atomicio(write, fileno(stdout), buf, strlen(buf));
 
        if (flag == -1) {
-               struct sigaction sa;
-               sa.sa_handler = updateprogressmeter;
-               sigemptyset((sigset_t *)&sa.sa_mask);
-#ifdef SA_RESTART
-               sa.sa_flags = SA_RESTART;
-#endif
-               sigaction(SIGALRM, &sa, NULL);
+               mysignal(SIGALRM, updateprogressmeter);
                alarmtimer(1);
        } else if (flag == 1) {
                alarmtimer(0);
This page took 0.098265 seconds and 4 git commands to generate.