1.1 --- a/libfsserver/lib/pipes/pipe_opener_resource.cc Mon Mar 21 00:17:42 2022 +0100
1.2 +++ b/libfsserver/lib/pipes/pipe_opener_resource.cc Tue Mar 22 23:03:44 2022 +0100
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * A pipe opener resource.
1.6 *
1.7 - * Copyright (C) 2021 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2021, 2022 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -21,6 +21,8 @@
1.13
1.14 #include <ipc/cap_alloc.h>
1.15
1.16 +#include <l4/cxx/exceptions>
1.17 +
1.18 #include "pipe_opener_resource.h"
1.19 #include "pipe_opener_server.h"
1.20 #include "pipe_pager.h"
1.21 @@ -53,7 +55,16 @@
1.22 {
1.23 /* Both endpoints will employ a common paging coordinator. */
1.24
1.25 - PipePaging *paging = new PipePaging(_memory, size);
1.26 + PipePaging *paging;
1.27 +
1.28 + try
1.29 + {
1.30 + paging = new PipePaging(_memory, size);
1.31 + }
1.32 + catch (L4::Out_of_memory const &e)
1.33 + {
1.34 + return -L4_ENOMEM;
1.35 + }
1.36
1.37 /* Each endpoint will have its own pager. */
1.38