aboutsummaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'text.c')
-rw-r--r--text.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/text.c b/text.c
index 9afab01..7ffe064 100644
--- a/text.c
+++ b/text.c
@@ -713,7 +713,7 @@ Text *text_load(const char *filename) {
if (fstat(txt->fd, &txt->info) == -1)
goto out;
if (!S_ISREG(txt->info.st_mode)) {
- errno = EISDIR;
+ errno = S_ISDIR(txt->info.st_mode) ? EISDIR : ENOTSUP;
goto out;
}
// XXX: use lseek(fd, 0, SEEK_END); instead?