mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-10-15 15:32:51 +00:00
qemu-nbd: fork() can fail
It is very unlikely, but it is possible. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-Id: <1424887718-10800-10-git-send-email-mreitz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
98f44bbe70
commit
70d4739ef2
|
@ -635,7 +635,9 @@ int main(int argc, char **argv)
|
||||||
* print errors and exit with the proper status code.
|
* print errors and exit with the proper status code.
|
||||||
*/
|
*/
|
||||||
pid = fork();
|
pid = fork();
|
||||||
if (pid == 0) {
|
if (pid < 0) {
|
||||||
|
err(EXIT_FAILURE, "Failed to fork");
|
||||||
|
} else if (pid == 0) {
|
||||||
close(stderr_fd[0]);
|
close(stderr_fd[0]);
|
||||||
ret = qemu_daemon(1, 0);
|
ret = qemu_daemon(1, 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue