diff options
author | des <des@FreeBSD.org> | 2009-11-10 10:42:48 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2009-11-10 10:42:48 +0000 |
commit | e256ac508b1a8eb7aedb8f720f3e650ecd273b53 (patch) | |
tree | 325f1afc222ed775c60ac807dda0315b81145ff8 /tools | |
parent | 340ba037cfa81f1baf1780b25f78fd0a5731dd75 (diff) | |
download | FreeBSD-src-e256ac508b1a8eb7aedb8f720f3e650ecd273b53.zip FreeBSD-src-e256ac508b1a8eb7aedb8f720f3e650ecd273b53.tar.gz |
Check fork() return value
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/lib/libutil/test-flopen.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/regression/lib/libutil/test-flopen.c b/tools/regression/lib/libutil/test-flopen.c index d6ecac3..a3ae35c 100644 --- a/tools/regression/lib/libutil/test-flopen.c +++ b/tools/regression/lib/libutil/test-flopen.c @@ -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); } |