commit 144a89326822d55c65997a37ea048622ceb96020
Author: sin <[email protected]>
Date:   Wed Jun 4 13:02:07 2014 +0100

    Ensure a proper exit code
    
    If copy() fails at least print stats.

diff --git a/dd.c b/dd.c
index c4db974..9942253 100644
--- a/dd.c
+++ b/dd.c
@@ -263,10 +263,10 @@ main(int argc, char *argv[])
        signal(SIGINT, sig_int);
 
        if (copy(&config) < 0)
-               eprintf("copy:");
+               weprintf("copy:");
        print_stat(&config);
 
        if (config.nosync == 0)
                sync(); sync();
-       return EXIT_SUCCESS;
+       return config.saved_errno;
 }


Reply via email to