diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-02-06 14:58:03 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-02-06 15:35:18 +0100 |
commit | 215c41710e842a892da23724d64c0f5414165496 (patch) | |
tree | 292606429787d90ca0388f27c28d17dc55a1b95a /tests/torture.c | |
parent | 97d261dc791a3b5e4b30bf384fd8a73da90d2372 (diff) | |
download | libssh-215c41710e842a892da23724d64c0f5414165496.tar.gz libssh-215c41710e842a892da23724d64c0f5414165496.tar.xz libssh-215c41710e842a892da23724d64c0f5414165496.zip |
torture: Added torture_isdir().
Diffstat (limited to 'tests/torture.c')
-rw-r--r-- | tests/torture.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/torture.c b/tests/torture.c index 7456cb60..983f1c38 100644 --- a/tests/torture.c +++ b/tests/torture.c @@ -128,6 +128,16 @@ int torture_rmdirs(const char *path) { return 0; } +int torture_isdir(const char *path) { + struct stat sb; + + if (lstat (path, &sb) == 0 && S_ISDIR(sb.st_mode)) { + return 1; + } + + return 0; +} + int torture_libssh_verbosity(void){ return verbosity; } |