Skip to content

Commit 9f10d3f

Browse files
committed
unix/main: Get rid of perror() which uses stdio.
1 parent 4120f32 commit 9f10d3f

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

unix/main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,7 @@ int main(int argc, char **argv) {
515515
char *pathbuf = malloc(PATH_MAX);
516516
char *basedir = realpath(argv[a], pathbuf);
517517
if (basedir == NULL) {
518-
mp_printf(&mp_stderr_print, "%s: can't open file '%s': [Errno %d] ", argv[0], argv[a], errno);
519-
perror("");
518+
mp_printf(&mp_stderr_print, "%s: can't open file '%s': [Errno %d] %s\n", argv[0], argv[a], errno, strerror(errno));
520519
// CPython exits with 2 in such case
521520
ret = 2;
522521
break;

0 commit comments

Comments
 (0)