From owner-freebsd-bugs@FreeBSD.ORG Wed Sep 28 09:30:13 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68219106564A for ; Wed, 28 Sep 2011 09:30:13 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3E49D8FC18 for ; Wed, 28 Sep 2011 09:30:13 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p8S9UCqp017684 for ; Wed, 28 Sep 2011 09:30:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p8S9UCbc017679; Wed, 28 Sep 2011 09:30:12 GMT (envelope-from gnats) Date: Wed, 28 Sep 2011 09:30:12 GMT Message-Id: <201109280930.p8S9UCbc017679@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: h h Cc: Subject: Re: bin/114465: [patch] [request] script(1): add really cool -d, -p & -r options from NetBSD X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: h h List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 09:30:13 -0000 The following reply was made to PR bin/114465; it has been noted by GNATS. From: h h To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/114465: [patch] [request] script(1): add really cool -d, -p & -r options from NetBSD Date: Wed, 28 Sep 2011 09:26:41 +0000 a few cosmetic changes - wrap long lines, also reduces diff with script.c from NetBSD - mark playback() as __dead2, it uses exit(3) and err(3) - add forgotten word after `the' in the manpage Also, the previous followup got revisions wrong - script.c@1.19 -> script.c@1.20 - script.1@1.12 -> script.1@1.13 --- a.diff begins here --- --- usr.bin/script/script.1~ +++ usr.bin/script/script.1 @@ -164,7 +164,7 @@ The .Fl p and .Fl r -first appeared in +options first appeared in .Nx 2.0 . .Sh BUGS The --- usr.bin/script/script.c~ +++ usr.bin/script/script.c @@ -86,7 +86,7 @@ static void fail(void); static void finish(void); static void record(FILE *, char *, size_t, int); static void consume(FILE *, off_t, char *, int); -static void playback(FILE *); +static void playback(FILE *) __dead2; static void usage(void); int @@ -108,7 +108,7 @@ main(int argc, char *argv[]) aflg = kflg = pflg = 0; usesleep = 1; rawout = 0; - + while ((ch = getopt(argc, argv, "adkpqrt:")) != -1) switch(ch) { case 'a': @@ -173,11 +173,13 @@ main(int argc, char *argv[]) tvec = time(NULL); (void)printf("Script started, output file is %s\n", fname); if (!rawout) { - (void)fprintf(fscript, "Script started on %s", ctime(&tvec)); + (void)fprintf(fscript, "Script started on %s", + ctime(&tvec)); if (argv[0]) { fprintf(fscript, "command: "); for (k = 0 ; argv[k] ; ++k) - fprintf(fscript, "%s%s", k ? " " : "", argv[k]); + fprintf(fscript, "%s%s", k ? " " : "", + argv[k]); fprintf(fscript, "\n"); } } @@ -325,7 +327,8 @@ done(int eno) record(fscript, NULL, 0, 'e'); if (!qflg) { if (!rawout) - (void)fprintf(fscript,"\nScript done on %s", ctime(&tvec)); + (void)fprintf(fscript,"\nScript done on %s", + ctime(&tvec)); (void)printf("\nScript done, output file is %s\n", fname); } (void)fclose(fscript); @@ -333,7 +336,6 @@ done(int eno) exit(eno); } - static void record(FILE *fp, char *buf, size_t cc, int direction) { @@ -421,13 +423,15 @@ playback(FILE *fp) switch (stamp.scr_direction) { case 's': if (!qflg) - (void)printf("Script started on %s", ctime(&tclock)); + (void)printf("Script started on %s", + ctime(&tclock)); tsi = tso; (void)consume(fp, stamp.scr_len, buf, reg); break; case 'e': if (!qflg) - (void)printf("\nScript done on %s", ctime(&tclock)); + (void)printf("\nScript done on %s", + ctime(&tclock)); (void)consume(fp, stamp.scr_len, buf, reg); break; case 'i': --- a.diff ends here ---