diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2023-09-08 05:56:14 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2023-09-08 05:56:14 +0000 |
commit | 2b890f7716e1c132bc0ced64db14a9a5bda9fc54 (patch) | |
tree | 3c64af573bc1e885951f07b1d5328087aed5d434 /usr.bin/ssh/sftp-glob.c | |
parent | 3666c129d7121467a3a73af87a31d3f7f38ddac6 (diff) |
the sftp code was one of my first contributions to OpenSSH and it
shows - the function names are terrible.
Rename do_blah() to sftp_blah() to make them less so.
Completely mechanical except for sftp_stat() and sftp_lstat() which
change from returning a pointer to a static variable (error-prone) to
taking a pointer to a caller-provided receiver.
Diffstat (limited to 'usr.bin/ssh/sftp-glob.c')
-rw-r--r-- | usr.bin/ssh/sftp-glob.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/usr.bin/ssh/sftp-glob.c b/usr.bin/ssh/sftp-glob.c index 32730913bcf..435acb9046e 100644 --- a/usr.bin/ssh/sftp-glob.c +++ b/usr.bin/ssh/sftp-glob.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-glob.c,v 1.31 2022/10/24 21:51:55 djm Exp $ */ +/* $OpenBSD: sftp-glob.c,v 1.32 2023/09/08 05:56:13 djm Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> * @@ -48,7 +48,7 @@ fudge_opendir(const char *path) r = xcalloc(1, sizeof(*r)); - if (do_readdir(cur.conn, path, &r->dir)) { + if (sftp_readdir(cur.conn, path, &r->dir)) { free(r); return(NULL); } @@ -76,32 +76,32 @@ fudge_readdir(struct SFTP_OPENDIR *od) static void fudge_closedir(struct SFTP_OPENDIR *od) { - free_sftp_dirents(od->dir); + sftp_free_dirents(od->dir); free(od); } static int fudge_lstat(const char *path, struct stat *st) { - Attrib *a; + Attrib a; - if (!(a = do_lstat(cur.conn, path, 1))) - return(-1); + if (sftp_lstat(cur.conn, path, 1, &a) != 0) + return -1; - attrib_to_stat(a, st); + attrib_to_stat(&a, st); - return(0); + return 0; } static int fudge_stat(const char *path, struct stat *st) { - Attrib *a; + Attrib a; - if (!(a = do_stat(cur.conn, path, 1))) - return(-1); + if (sftp_stat(cur.conn, path, 1, &a) != 0) + return -1; - attrib_to_stat(a, st); + attrib_to_stat(&a, st); return(0); } |