diff options
author | jbj <devnull@localhost> | 2002-02-24 20:44:36 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-02-24 20:44:36 +0000 |
commit | ec53bfce3db7d7a0802cae1ff5143f9e6beaf040 (patch) | |
tree | 73f8a44c2bbff571ad7d60fa99aa2e0371312150 /rpmio/rpmrpc.c | |
parent | 02893e232d2dcb8bf70a7b7244e792f2f27b9d32 (diff) | |
download | librpm-tizen-ec53bfce3db7d7a0802cae1ff5143f9e6beaf040.tar.gz librpm-tizen-ec53bfce3db7d7a0802cae1ff5143f9e6beaf040.tar.bz2 librpm-tizen-ec53bfce3db7d7a0802cae1ff5143f9e6beaf040.zip |
Synthesize a st_ino field for fts(3) use across FTP.
CVS patchset: 5335
CVS date: 2002/02/24 20:44:36
Diffstat (limited to 'rpmio/rpmrpc.c')
-rw-r--r-- | rpmio/rpmrpc.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c index 1b36eb8ea..17483b50b 100644 --- a/rpmio/rpmrpc.c +++ b/rpmio/rpmrpc.c @@ -1006,6 +1006,23 @@ exit: } /*@=mods@*/ +static const char * statstr(struct stat * st) +{ + static char buf[1024]; +sprintf(buf, "*** dev %x ino %x mode %0o nlink %d uid %d gid %d rdev %x size %x\n", +(unsigned)st->st_dev, +(unsigned)st->st_ino, +st->st_mode, +st->st_nlink, +st->st_uid, +st->st_gid, +(unsigned)st->st_rdev, +(unsigned)st->st_size); + return buf; +} + +static int ftp_st_ino = 0x1000; + static int ftpStat(const char * path, /*@out@*/ struct stat *st) /*@globals fileSystem @*/ /*@modifies *st, fileSystem @*/ @@ -1013,7 +1030,10 @@ static int ftpStat(const char * path, /*@out@*/ struct stat *st) int rc; rc = ftpNLST(path, DO_FTP_STAT, st, NULL, 0); if (_ftp_debug) -fprintf(stderr, "*** ftpStat(%s) rc %d\n", path, rc); +fprintf(stderr, "*** ftpStat(%s) rc %d\n%s", path, rc, statstr(st)); + /* XXX fts(3) needs/uses st_ino, make something up for now. */ + if (st->st_ino == 0) + st->st_ino = ftp_st_ino++; return rc; } @@ -1024,7 +1044,11 @@ static int ftpLstat(const char * path, /*@out@*/ struct stat *st) int rc; rc = ftpNLST(path, DO_FTP_LSTAT, st, NULL, 0); if (_ftp_debug) -fprintf(stderr, "*** ftpLstat(%s) rc %d\n", path, rc); +fprintf(stderr, "*** ftpLstat(%s) rc %d\n%s\n", path, rc, statstr(st)); +st->st_ino = ftp_st_ino++; + /* XXX fts(3) needs/uses st_ino, make something up for now. */ + if (st->st_ino == 0) + st->st_ino = ftp_st_ino++; return rc; } |