Author: bonefish Date: 2011-01-11 20:15:14 +0100 (Tue, 11 Jan 2011) New Revision: 40206 Changeset: http://dev.haiku-os.org/changeset/40206 Modified: haiku/branches/developer/bonefish/signals/src/system/kernel/fs/fd.cpp Log: dup_foreign_fd(): Simplified using Team::Get(). Modified: haiku/branches/developer/bonefish/signals/src/system/kernel/fs/fd.cpp =================================================================== --- haiku/branches/developer/bonefish/signals/src/system/kernel/fs/fd.cpp 2011-01-11 18:56:28 UTC (rev 40205) +++ haiku/branches/developer/bonefish/signals/src/system/kernel/fs/fd.cpp 2011-01-11 19:15:14 UTC (rev 40206) @@ -476,18 +476,13 @@ dup_foreign_fd(team_id fromTeam, int fd, bool kernel) { // get the I/O context for the team in question - InterruptsSpinLocker teamsLocker(gTeamSpinlock); - Team* team = team_get_team_struct_locked(fromTeam); + Team* team = Team::Get(fromTeam); if (team == NULL) return B_BAD_TEAM_ID; + BReference<Team> teamReference(team, true); io_context* fromContext = team->io_context; - vfs_get_io_context(fromContext); - teamsLocker.Unlock(); - - CObjectDeleter<io_context> _(fromContext, vfs_put_io_context); - // get the file descriptor file_descriptor* descriptor = get_fd(fromContext, fd); if (descriptor == NULL)