From edb4a0120b20d269084ae80ac60d5d7bc6522482 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sat, 27 Jan 1996 16:36:53 +0000 Subject: (diskfs_S_file_exec): Use diskfs_create_protid instead of diskfs_make_protid, and deal with an error return. --- libdiskfs/file-exec.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'libdiskfs') diff --git a/libdiskfs/file-exec.c b/libdiskfs/file-exec.c index 4521585f..7cde0e37 100644 --- a/libdiskfs/file-exec.c +++ b/libdiskfs/file-exec.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1993, 1994, 1995 Free Software Foundation + Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation This file is part of the GNU Hurd. @@ -113,23 +113,27 @@ diskfs_S_file_exec (struct protid *cred, flags |= EXEC_NEWTASK; #endif - newpi = diskfs_make_protid (diskfs_make_peropen (np, O_READ, + err = diskfs_create_protid (diskfs_make_peropen (np, O_READ, cred->po->dotdotport), cred->uids, cred->nuids, - cred->gids, cred->ngids); + cred->gids, cred->ngids, + &newpi); mutex_unlock (&np->lock); - err = exec_exec (diskfs_exec, - ports_get_right (newpi), - MACH_MSG_TYPE_MAKE_SEND, - task, flags, argv, argvlen, envp, envplen, - fds, MACH_MSG_TYPE_COPY_SEND, fdslen, - portarray, MACH_MSG_TYPE_COPY_SEND, portarraylen, - intarray, intarraylen, deallocnames, deallocnameslen, - destroynames, destroynameslen); - - ports_port_deref (newpi); - if (!err) + if (! err) + { + err = exec_exec (diskfs_exec, + ports_get_right (newpi), + MACH_MSG_TYPE_MAKE_SEND, + task, flags, argv, argvlen, envp, envplen, + fds, MACH_MSG_TYPE_COPY_SEND, fdslen, + portarray, MACH_MSG_TYPE_COPY_SEND, portarraylen, + intarray, intarraylen, deallocnames, deallocnameslen, + destroynames, destroynameslen); + ports_port_deref (newpi); + } + + if (! err) { unsigned int i; -- cgit v1.2.3