Skip to content
Snippets Groups Projects
Commit dcf08bd8 authored by Tillmann Karras's avatar Tillmann Karras
Browse files

Consistently print errors to stderr

parent cf9145a7
No related branches found
No related tags found
No related merge requests found
...@@ -173,7 +173,7 @@ static void argv_parse(int argc, char **argv) { ...@@ -173,7 +173,7 @@ static void argv_parse(int argc, char **argv) {
case 1 : exclude_add(val); break; /* --exclude */ case 1 : exclude_add(val); break; /* --exclude */
case 'X': case 'X':
if(exclude_addfile(val)) { if(exclude_addfile(val)) {
printf("Can't open %s: %s\n", val, strerror(errno)); fprintf(stderr, "Can't open %s: %s\n", val, strerror(errno));
exit(1); exit(1);
} }
break; break;
...@@ -181,14 +181,14 @@ static void argv_parse(int argc, char **argv) { ...@@ -181,14 +181,14 @@ static void argv_parse(int argc, char **argv) {
cachedir_tags = 1; cachedir_tags = 1;
break; break;
case -2: case -2:
printf("ncdu: %s.\n", val); fprintf(stderr, "ncdu: %s.\n", val);
exit(1); exit(1);
} }
} }
if(export) { if(export) {
if(dir_export_init(export)) { if(dir_export_init(export)) {
printf("Can't open %s: %s\n", export, strerror(errno)); fprintf(stderr, "Can't open %s: %s\n", export, strerror(errno));
exit(1); exit(1);
} }
if(strcmp(export, "-") == 0) if(strcmp(export, "-") == 0)
...@@ -198,7 +198,7 @@ static void argv_parse(int argc, char **argv) { ...@@ -198,7 +198,7 @@ static void argv_parse(int argc, char **argv) {
if(import) { if(import) {
if(dir_import_init(import)) { if(dir_import_init(import)) {
printf("Can't open %s: %s\n", import, strerror(errno)); fprintf(stderr, "Can't open %s: %s\n", import, strerror(errno));
exit(1); exit(1);
} }
if(strcmp(import, "-") == 0) if(strcmp(import, "-") == 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment