aboutsummaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-01-09 23:21:17 +0100
committerMarc André Tanner <mat@brain-dump.org>2015-01-11 18:02:54 +0100
commit6ee9404767a778664125ed8b04bf2eeb39c904f8 (patch)
tree11252fa8947d5a644ddad2d3cdeb50c8f728cdc9 /text.c
parentdf9e5dd597f74d810ecd30740c4743795acfd7a4 (diff)
downloadvis-6ee9404767a778664125ed8b04bf2eeb39c904f8.tar.gz
vis-6ee9404767a778664125ed8b04bf2eeb39c904f8.tar.xz
More useful error message when opening non regular files
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?