Ensure a proper exit code
If copy() fails at least print stats.
This commit is contained in:
parent
7fa098ace6
commit
144a893268
4
dd.c
4
dd.c
@ -263,10 +263,10 @@ main(int argc, char *argv[])
|
|||||||
signal(SIGINT, sig_int);
|
signal(SIGINT, sig_int);
|
||||||
|
|
||||||
if (copy(&config) < 0)
|
if (copy(&config) < 0)
|
||||||
eprintf("copy:");
|
weprintf("copy:");
|
||||||
print_stat(&config);
|
print_stat(&config);
|
||||||
|
|
||||||
if (config.nosync == 0)
|
if (config.nosync == 0)
|
||||||
sync(); sync();
|
sync(); sync();
|
||||||
return EXIT_SUCCESS;
|
return config.saved_errno;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user