From 25639ca722b69a3821bb6622fef795a7138bd3dc Mon Sep 17 00:00:00 2001 From: Mike Barcroft Date: Mon, 21 Apr 2003 17:20:48 +0000 Subject: [PATCH] Force output of jail ID (if necessary) before excuting the command, otherwise redirection of stdout to a file using block buffering will not complete in time. --- usr.sbin/jail/jail.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/jail/jail.c b/usr.sbin/jail/jail.c index 87bc483a9ab4..62db696a0e78 100644 --- a/usr.sbin/jail/jail.c +++ b/usr.sbin/jail/jail.c @@ -80,8 +80,10 @@ main(int argc, char **argv) i = jail(&j); if (i == -1) err(1, "jail"); - if (iflag) + if (iflag) { printf("%d\n", i); + fflush(stdout); + } if (username != NULL) { if (setgroups(ngroups, groups) != 0) err(1, "setgroups");