mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-22 15:47:37 +00:00
Check fork() return value
This commit is contained in:
parent
151a18cd10
commit
1a29dc59c5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=199134
@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* Copyright (c) 2007-2009 Dag-Erling Coïdan Smørgrav
|
||||
* Copyright (c) 2007-2009 Dag-Erling Coïdan Smørgrav
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -161,7 +161,10 @@ test_flopen_lock_child(void)
|
||||
if (fd1 < 0) {
|
||||
result = strerror(errno);
|
||||
} else {
|
||||
if ((pid = fork()) == 0) {
|
||||
pid = fork();
|
||||
if (pid == -1) {
|
||||
result = strerror(errno);
|
||||
} else if (pid == 0) {
|
||||
select(0, 0, 0, 0, 0);
|
||||
_exit(0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user