summaryrefslogtreecommitdiff
path: root/utils/msgport.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>2000-03-17 17:26:36 +0000
committerThomas Bushnell <thomas@gnu.org>2000-03-17 17:26:36 +0000
commit0d74b8eb06950f1e784f298d5a29568c5990e701 (patch)
treeec6674c9a8a6af86938a05ef7c96e245a5ebdc5e /utils/msgport.c
parent166c15f084adc62b6d0411dca9f65928aee479b7 (diff)
2000-03-17 Thomas Bushnell, BSG <tb@mit.edu>
* frobauth-mod.c (frobauth_modify): Don't use MOVE_SEND in Hurd RPC. * msgport.c (do_setfd, cmd_chcwdir, cmd_cdroot, cmd_chcrdir): Likewise.
Diffstat (limited to 'utils/msgport.c')
-rw-r--r--utils/msgport.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/utils/msgport.c b/utils/msgport.c
index 59362d87..5e942d48 100644
--- a/utils/msgport.c
+++ b/utils/msgport.c
@@ -1,6 +1,6 @@
/* Send messages to selected processes
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
Written by Jose M. Moya <josem@gnu.org>
@@ -197,7 +197,8 @@ do_setfd (pid_t pid, mach_port_t msgport, size_t fd, file_t file)
err = proc_pid2task (proc, pid, &task);
if (err)
return err;
- err = msg_set_fd (msgport, task, fd, file, MACH_MSG_TYPE_MOVE_SEND);
+ err = msg_set_fd (msgport, task, fd, file, MACH_MSG_TYPE_COPY_SEND);
+ mach_port_deallocate (mach_task_self (), file);
mach_port_deallocate (mach_task_self (), task);
return err;
}
@@ -302,9 +303,8 @@ cmd_chcwdir (pid_t pid, mach_port_t msgport, int argc, char *argv[])
return err;
}
err = msg_set_init_port (msgport, task, INIT_PORT_CWDIR, dir,
- MACH_MSG_TYPE_MOVE_SEND);
- if (err)
- mach_port_deallocate (mach_task_self (), dir);
+ MACH_MSG_TYPE_COPY_SEND);
+ mach_port_deallocate (mach_task_self (), dir);
mach_port_deallocate (mach_task_self (), task);
return err;
}
@@ -328,9 +328,8 @@ cmd_cdroot (pid_t pid, mach_port_t msgport, int argc, char *argv[])
return err;
}
err = msg_set_init_port (msgport, task, INIT_PORT_CWDIR, dir,
- MACH_MSG_TYPE_MOVE_SEND);
- if (err)
- mach_port_deallocate (mach_task_self (), dir);
+ MACH_MSG_TYPE_COPY_SEND);
+ mach_port_deallocate (mach_task_self (), dir);
mach_port_deallocate (mach_task_self (), task);
return err;
}
@@ -354,9 +353,8 @@ cmd_chcrdir (pid_t pid, mach_port_t msgport, int argc, char *argv[])
return err;
}
err = msg_set_init_port (msgport, task, INIT_PORT_CRDIR, dir,
- MACH_MSG_TYPE_MOVE_SEND);
- if (err)
- mach_port_deallocate (mach_task_self (), dir);
+ MACH_MSG_TYPE_COPY_SEND);
+ mach_port_deallocate (mach_task_self (), dir);
mach_port_deallocate (mach_task_self (), task);
return err;
}