diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2004-11-29 07:41:25 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2004-11-29 07:41:25 +0000 |
commit | 0e91e5b94fb68ab00eed960bad30f73eba33c15b (patch) | |
tree | 3479f6fc7af36e240fd6fc3aa13acdc66bfdf89b | |
parent | a1af43e11e4ea7a2184567b2986bb89cb5ffc37c (diff) |
Some small fixes from moritz@jodeit.org. ok deraadt@
-rw-r--r-- | usr.bin/ssh/sftp-client.h | 6 | ||||
-rw-r--r-- | usr.bin/ssh/sftp.c | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/ssh/sftp-client.h b/usr.bin/ssh/sftp-client.h index a0e8e44b3c2..991e05d3324 100644 --- a/usr.bin/ssh/sftp-client.h +++ b/usr.bin/ssh/sftp-client.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-client.h,v 1.12 2004/02/17 05:39:51 djm Exp $ */ +/* $OpenBSD: sftp-client.h,v 1.13 2004/11/29 07:41:24 djm Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> @@ -30,8 +30,8 @@ struct SFTP_DIRENT { }; /* - * Initialiase a SSH filexfer connection. Returns -1 on error or - * protocol version on success. + * Initialiase a SSH filexfer connection. Returns NULL on error or + * a pointer to a initialized sftp_conn struct on success. */ struct sftp_conn *do_init(int, int, u_int, u_int); diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c index 70b8963f767..da2bb921e9b 100644 --- a/usr.bin/ssh/sftp.c +++ b/usr.bin/ssh/sftp.c @@ -16,7 +16,7 @@ #include "includes.h" -RCSID("$OpenBSD: sftp.c,v 1.58 2004/11/25 22:22:14 markus Exp $"); +RCSID("$OpenBSD: sftp.c,v 1.59 2004/11/29 07:41:24 djm Exp $"); #include <glob.h> #include <histedit.h> @@ -155,9 +155,11 @@ static void cmd_interrupt(int signo) { const char msg[] = "\rInterrupt \n"; + int olderrno = errno; write(STDERR_FILENO, msg, sizeof(msg) - 1); interrupted = 1; + errno = olderrno; } static void @@ -257,7 +259,7 @@ path_strip(char *path, char *strip) return (xstrdup(path)); len = strlen(strip); - if (strip != NULL && strncmp(path, strip, len) == 0) { + if (strncmp(path, strip, len) == 0) { if (strip[len - 1] != '/' && path[len] == '/') len++; return (xstrdup(path + len)); |