]> git.cameronkatri.com Git - mandoc.git/blobdiff - read.c
Move the full responsibility for reporting open(2) errors from
[mandoc.git] / read.c
diff --git a/read.c b/read.c
index 081230262acbffecc71489aa165dd74c52ef1588..17200e0932736b734923f9d89d7a17bf9140a39d 100644 (file)
--- a/read.c
+++ b/read.c
@@ -1,4 +1,4 @@
-/*     $Id: read.c,v 1.207 2018/12/14 06:33:14 schwarze Exp $ */
+/*     $Id: read.c,v 1.208 2018/12/20 21:30:32 schwarze Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010-2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -372,8 +372,9 @@ rerun:
                                mparse_readfd(curp, fd, ln.buf + of);
                                close(fd);
                        } else {
-                               mandoc_msg(MANDOCERR_SO_FAIL, curp->line,
-                                   pos, ".so %s", ln.buf + of);
+                               mandoc_msg(MANDOCERR_SO_FAIL,
+                                   curp->line, of, ".so %s: %s",
+                                   ln.buf + of, strerror(errno));
                                ln.sz = mandoc_asprintf(&cp,
                                    ".sp\nSee the file %s.\n.sp",
                                    ln.buf + of);
@@ -633,7 +634,6 @@ mparse_open(struct mparse *curp, const char *file)
 
        /* Neither worked, give up. */
 
-       mandoc_msg(MANDOCERR_FILE, 0, 0, "%s", strerror(errno));
        return -1;
 }