Commits

Sebastian Freundt committed 28c2063

fix, don't print errnos willy-nilly, have the caller of error() pass it

Signed-off-by: Sebastian Freundt <freundt@ga-group.nl>

  • Participants
  • Parent commits c1da131

Comments (0)

Files changed (1)

 	fputs("ddiff: ", stderr);
 	vfprintf(stderr, fmt, vap);
 	va_end(vap);
-	if (eno || errno) {
+	if (eno) {
 		fputc(':', stderr);
 		fputc(' ', stderr);
 		fputs(strerror(eno ? eno : errno), stderr);
 
 		/* using the prchunk reader now */
 		if ((pctx = init_prchunk(STDIN_FILENO)) == NULL) {
-			error(0, "Error: could not open stdin");
+			error(errno, "Error: could not open stdin");
 			goto out;
 		}
 		while (prchunk_fill(pctx) >= 0) {