diff options
Diffstat (limited to 'lib/kernel')
-rw-r--r-- | lib/kernel/src/pg2.erl | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/kernel/src/pg2.erl b/lib/kernel/src/pg2.erl index fc9508a194..cb9fec2ffe 100644 --- a/lib/kernel/src/pg2.erl +++ b/lib/kernel/src/pg2.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% -module(pg2). @@ -334,8 +334,11 @@ local_group_members(Name) -> P <- member_in_group(Pid, Name)]. member_in_group(Pid, Name) -> - [{{member, Name, Pid}, N}] = ets:lookup(pg2_table, {member, Name, Pid}), - lists:duplicate(N, Pid). + case ets:lookup(pg2_table, {member, Name, Pid}) of + [] -> []; + [{{member, Name, Pid}, N}] -> + lists:duplicate(N, Pid) + end. member_groups(Pid) -> [Name || [Name] <- ets:match(pg2_table, {{pid, Pid, '$1'}})]. |