Mikulas Patocka
3395d72881
Change exit() to _exit() in the child process. exit flushes stdio file buffers,
...
_exit doesn't. If there were some open files, an error in exec and subsequent
exit() would cause the buffers to be flushed twice.
Example:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
int main()
{
printf("buu");
if (!fork()) {
execl("/bin/true-not-exists", "/bin/true", NULL);
exit(1);
}
wait(NULL);
return 0;
}
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com
---
daemons/dmeventd/libdevmapper-event.c | 2 +-
lib/misc/lvm-exec.c | 2 +-
test/harness.c | 3 ++-
tools/dmsetup.c | 2 +-
4 files changed, 5 insertions(+), 4 deletions(-)
2009-07-13 21:26:41 +00:00
..
2009-05-22 14:44:59 +00:00
2007-09-18 14:00:42 +00:00
2009-07-13 21:26:41 +00:00
2008-11-04 14:37:51 +00:00
2009-05-08 06:10:45 +00:00
2009-03-16 18:28:04 +00:00
2007-09-18 14:02:22 +00:00
2009-02-17 19:37:28 +00:00
2009-07-13 12:42:26 +00:00
2009-07-07 19:28:57 +00:00
2009-01-15 17:14:38 +00:00
2009-07-01 17:06:04 +00:00
2009-04-21 12:59:18 +00:00
2009-06-04 12:01:15 +00:00
2008-11-11 15:29:24 +00:00
2008-11-10 12:43:35 +00:00
2009-06-01 15:55:06 +00:00
2009-05-11 03:37:34 +00:00
2009-07-08 18:14:47 +00:00
2008-09-29 16:02:50 +00:00
2008-09-29 16:02:50 +00:00
2009-04-03 14:23:17 +00:00
2008-11-11 15:46:15 +00:00
2008-11-10 12:37:53 +00:00
2008-11-11 15:29:24 +00:00
2009-06-01 14:43:27 +00:00
2008-11-10 12:41:52 +00:00
2008-11-10 12:32:00 +00:00
2009-04-22 17:00:28 +00:00
2008-11-10 13:44:01 +00:00
2008-10-06 16:47:07 +00:00
2008-10-06 16:47:07 +00:00
2008-10-06 16:47:07 +00:00
2009-06-06 16:40:39 +00:00
2009-06-06 16:40:39 +00:00
2009-05-19 09:51:02 +00:00
2008-11-10 12:41:52 +00:00
2009-06-06 16:40:39 +00:00
2009-06-10 20:17:32 +00:00
2009-05-19 09:48:32 +00:00
2008-11-11 15:29:24 +00:00
2009-07-09 08:50:55 +00:00
2008-11-10 12:41:52 +00:00
2008-10-06 16:47:07 +00:00
2008-11-10 12:43:35 +00:00
2009-06-05 10:42:22 +00:00
2008-09-30 18:29:10 +00:00
2008-11-10 12:43:35 +00:00
2008-09-29 16:00:53 +00:00
2009-05-13 21:29:10 +00:00