From dd4370e31e548374a76b52e9aece8eae9669abba Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 26 Jun 2002 18:19:07 +0000 Subject: 2002-06-26 Roland McGrath * swapon.c (swaponoff): Fix last change. --- sutils/swapon.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/sutils/swapon.c b/sutils/swapon.c index a50cd41d..acacf48c 100644 --- a/sutils/swapon.c +++ b/sutils/swapon.c @@ -383,15 +383,18 @@ swaponoff (const char *file, int add) return 0; } } - if (err) - error (12, err, "Cannot get privileged ports"); - - err = vm_set_default_memory_manager (host, &def_pager); - mach_port_deallocate (mach_task_self (), host); - if (err) - error (13, err, "Cannot get default pager port"); - if (def_pager == MACH_PORT_NULL) - error (14, 0, "No default pager (memory manager) is running!"); + else + { + if (err) + error (12, err, "Cannot get privileged ports"); + + err = vm_set_default_memory_manager (host, &def_pager); + mach_port_deallocate (mach_task_self (), host); + if (err) + error (13, err, "Cannot get default pager port"); + if (def_pager == MACH_PORT_NULL) + error (14, 0, "No default pager (memory manager) is running!"); + } } if (old_protocol) -- cgit v1.2.3