diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-30 15:15:08 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-30 15:15:08 +0200 |
commit | 5632ddb849821bf8c4fac9f4aa8c4779575eef97 (patch) | |
tree | c0f5cdeabec71de882f7d6dcbfffc0daeb0c961a /inc | |
parent | 0a901ba3e651a70984e980f61619b005031a71f0 (diff) | |
download | abrt-5632ddb849821bf8c4fac9f4aa8c4779575eef97.tar.gz abrt-5632ddb849821bf8c4fac9f4aa8c4779575eef97.tar.xz abrt-5632ddb849821bf8c4fac9f4aa8c4779575eef97.zip |
fix all instances of dent->d_type == DT_REG checks
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'inc')
-rw-r--r-- | inc/abrtlib.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/inc/abrtlib.h b/inc/abrtlib.h index c99f4b7e..02906f2f 100644 --- a/inc/abrtlib.h +++ b/inc/abrtlib.h @@ -122,6 +122,13 @@ void xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen); void xlisten(int s, int backlog); ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to, socklen_t tolen); void xstat(const char *name, struct stat *stat_buf); +/* Just testing dent->d_type == DT_REG is wrong: some filesystems + * do not report the type, they report DT_UNKNOWN for every dirent + * (and this is not a bug in filesystem, this is allowed by standards). + * This function handles this case. Note: it returns 0 on symlinks + * even if they point to regular files. + */ +int is_regular_file(struct dirent *dent, const char *dirname); void xmove_fd(int from, int to); char* xasprintf(const char *format, ...); |