-o: accept "-" as name, do nothing (leave stderr as is)
[tfcrypt.git] / tfcrypt.c
index df7cc29f130d485b3e11ff0007615171a573e7f4..4eb2b04cc5d620af0741ed66af20c1f7998d54e1 100644 (file)
--- a/tfcrypt.c
+++ b/tfcrypt.c
@@ -34,10 +34,12 @@ static void open_log(const char *logfile)
 {
        int fd;
 
+       if (!strcmp(logfile, "-")) return;
+
        fd = open(logfile, O_WRONLY | O_CREAT | O_LARGEFILE | O_TRUNC, 0666);
        if (fd == -1) xerror(NO, NO, YES, "%s", logfile);
        xclose(2);
-       if (dup2(fd, 2) == -1) xerror(NO, NO, YES, "dup2(%d, 2) for %s", fd, logfile);
+       if (dup2(fd, 2) == -1) xexit(2);
        xclose(fd);
        do_statline_dynamic = NO;
 }
@@ -332,6 +334,8 @@ _baddfname:
                                                do_full_key = YES;
                                        else if (!strcmp(s, "showsecrets"))
                                                show_secrets = YES;
+                                       else if (!strcmp(s, "finished"))
+                                               show_when_done = YES;
                                        else if (!strncmp(s, "logfile", 7) && *(s+7) == '=')
                                                open_log(s+8);
                                        else if (!strncmp(s, "iobs", 4) && *(s+4) == '=') {