Mercurial > gftp.yaz
diff lib/protocols.c @ 520:e67a52327b24
2004-7-27 Brian Masney <masneyb@gftp.org>
* lib/gftp.h lib/local.c lib/protocols.c lib/sshv2.c - changed
declaration of gftp_stat_filename() so that the mode of the filename
is returned as a parameter instead of the function return value.
The mode_t type is unsigned and the error codes could not be reported
properly
author | masneyb |
---|---|
date | Wed, 28 Jul 2004 02:19:00 +0000 |
parents | c6a6e908dbaf |
children | bccfdbfaac00 |
line wrap: on
line diff
--- a/lib/protocols.c Wed Jul 28 01:58:28 2004 +0000 +++ b/lib/protocols.c Wed Jul 28 02:19:00 2004 +0000 @@ -339,19 +339,16 @@ } -mode_t /* FIXME - this is unsigned, can return negative */ -gftp_stat_filename (gftp_request * request, const char *filename) +int +gftp_stat_filename (gftp_request * request, const char *filename, mode_t * mode) { - mode_t ret; - g_return_val_if_fail (request != NULL, GFTP_EFATAL); + g_return_val_if_fail (filename != NULL, GFTP_EFATAL); if (request->stat_filename != NULL) - ret = request->stat_filename (request, filename); + return (request->stat_filename (request, filename, mode)); else - ret = 0; - - return (ret); + return (0); } @@ -1964,9 +1961,10 @@ if (S_ISLNK (curfle->st_mode) && !S_ISDIR (curfle->st_mode)) { - st_mode = gftp_stat_filename (transfer->fromreq, curfle->file); - if (st_mode < 0) - return (st_mode); + st_mode = 0; + ret = gftp_stat_filename (transfer->fromreq, curfle->file, &st_mode); + if (ret < 0) + return (ret); else if (S_ISDIR (st_mode)) curfle->st_mode = st_mode; }