lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120614162257.GA5238@redhat.com>
Date:	Thu, 14 Jun 2012 12:22:57 -0400
From:	Dave Jones <davej@...hat.com>
To:	Linux Kernel <linux-kernel@...r.kernel.org>,
	Alan Cox <alan@...rguk.ukuu.org.uk>
Subject: Re: 3.5.rc2 tty buffering bug ?

On Thu, Jun 14, 2012 at 12:13:31PM -0400, Dave Jones wrote:
 
 > #include <stdio.h>
 > 
 > void main()
 > {
 > 	printf("begin\n");
 > 
 > 	if (fork() != 0)
 > 		printf("child\n");
 > 	else
 > 		printf("parent\n");
 > 
 > 	printf("end\n");
 > }
 > 
 > How does 'begin' get printed a second time ?

Someone pointed out that an fflush is needed before the fork.
Somehow I've managed to go all these years without knowing that.

	Dave

 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ