Make init_thread request deal better with fd allocation errors.
diff --git a/server/thread.c b/server/thread.c
index 14c42bd..ced3189 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -841,9 +841,14 @@
fatal_protocol_error( current, "bad wait fd\n" );
goto error;
}
- current->reply_fd = create_anonymous_fd( &thread_fd_ops, reply_fd, ¤t->obj );
- current->wait_fd = create_anonymous_fd( &thread_fd_ops, wait_fd, ¤t->obj );
- if (!current->reply_fd || !current->wait_fd) return;
+ if (!(current->reply_fd = create_anonymous_fd( &thread_fd_ops, reply_fd, ¤t->obj )))
+ {
+ reply_fd = -1;
+ fatal_protocol_error( current, "could not allocate reply fd\n" );
+ goto error;
+ }
+ if (!(current->wait_fd = create_anonymous_fd( &thread_fd_ops, wait_fd, ¤t->obj )))
+ return;
current->unix_pid = req->unix_pid;
current->unix_tid = req->unix_tid;