diff options
Diffstat (limited to 'sutils/swapon.c')
-rw-r--r-- | sutils/swapon.c | 21 |
1 files 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) |