diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-01-09 23:21:17 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-01-11 18:02:54 +0100 |
| commit | 6ee9404767a778664125ed8b04bf2eeb39c904f8 (patch) | |
| tree | 11252fa8947d5a644ddad2d3cdeb50c8f728cdc9 /text.c | |
| parent | df9e5dd597f74d810ecd30740c4743795acfd7a4 (diff) | |
| download | vis-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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? |
