=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/sftp-glob.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/usr.bin/ssh/sftp-glob.c 2001/12/19 07:18:56 1.9 +++ src/usr.bin/ssh/sftp-glob.c 2002/02/13 00:59:23 1.10 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001 Damien Miller. All rights reserved. + * Copyright (c) 2001,2002 Damien Miller. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sftp-glob.c,v 1.9 2001/12/19 07:18:56 deraadt Exp $"); +RCSID("$OpenBSD: sftp-glob.c,v 1.10 2002/02/13 00:59:23 djm Exp $"); #include @@ -43,8 +43,7 @@ }; static struct { - int fd_in; - int fd_out; + struct sftp_conn *conn; } cur; static void * @@ -54,7 +53,7 @@ r = xmalloc(sizeof(*r)); - if (do_readdir(cur.fd_in, cur.fd_out, (char*)path, &r->dir)) + if (do_readdir(cur.conn, (char*)path, &r->dir)) return(NULL); r->offset = 0; @@ -108,7 +107,7 @@ { Attrib *a; - if (!(a = do_lstat(cur.fd_in, cur.fd_out, (char*)path, 0))) + if (!(a = do_lstat(cur.conn, (char*)path, 0))) return(-1); attrib_to_stat(a, st); @@ -121,7 +120,7 @@ { Attrib *a; - if (!(a = do_stat(cur.fd_in, cur.fd_out, (char*)path, 0))) + if (!(a = do_stat(cur.conn, (char*)path, 0))) return(-1); attrib_to_stat(a, st); @@ -130,7 +129,7 @@ } int -remote_glob(int fd_in, int fd_out, const char *pattern, int flags, +remote_glob(struct sftp_conn *conn, const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob) { pglob->gl_opendir = fudge_opendir; @@ -140,9 +139,7 @@ pglob->gl_stat = fudge_stat; memset(&cur, 0, sizeof(cur)); - cur.fd_in = fd_in; - cur.fd_out = fd_out; + cur.conn = conn; - return(glob(pattern, flags | GLOB_ALTDIRFUNC, errfunc, - pglob)); + return(glob(pattern, flags | GLOB_ALTDIRFUNC, errfunc, pglob)); }