1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/misc
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
..
configure.h.in no need for libdevmapper.h on system any more 2008-11-10 21:25:45 +00:00
crc.c Some whitespace tidy-ups. 2008-01-30 14:00:02 +00:00
crc.h Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
intl.h Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
last-path-component.h cleaner const char* usage for last_path_component() 2008-11-12 09:53:33 +00:00
lib.h more tweaking to get things to compile - dmlib.h for log fns, list.h 2008-11-03 18:59:59 +00:00
lvm-exec.c Change exit() to _exit() in the child process. exit flushes stdio file buffers, 2009-07-13 21:26:41 +00:00
lvm-exec.h Attempt cleanup in child before execing new binary in exec_cmd() 2009-02-28 00:54:06 +00:00
lvm-file.c Make _init_rand() thread safe - use rand_r() instead of rand(). 2008-12-07 04:27:56 +00:00
lvm-file.h Make _init_rand() thread safe - use rand_r() instead of rand(). 2008-12-07 04:27:56 +00:00
lvm-globals.c Create global is_static() to eliminate from the library init function. 2008-12-18 05:27:17 +00:00
lvm-globals.h Create global is_static() to eliminate from the library init function. 2008-12-18 05:27:17 +00:00
lvm-string.c Escape double quotes and backslashes in external metadata and config data. 2008-03-12 16:03:22 +00:00
lvm-string.h Escape double quotes and backslashes in external metadata and config data. 2008-03-12 16:03:22 +00:00
lvm-version.h.in Move tools/version.h to lib/misc/lvm-version.h. 2009-02-22 22:11:58 +00:00
lvm-wrappers.c Add generic function to read /dev/urandom, used in uuid calculation. 2008-12-07 04:23:37 +00:00
lvm-wrappers.h Add generic function to read /dev/urandom, used in uuid calculation. 2008-12-07 04:23:37 +00:00
sharedlib.c Create global is_static() to eliminate from the library init function. 2008-12-18 05:27:17 +00:00
sharedlib.h Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
timestamp.c Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
timestamp.h Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
util.c Fix the fsadm build failure without using -llvm. 2007-10-03 16:10:04 +00:00
util.h Add uninitialized_var macro to suppress invalid compiler warnings. 2008-06-23 19:04:34 +00:00