Subject: Re: port-i386/36952: swapctl(8) doesn't
To: None <port-i386-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: dieter roelants <dieter.NetBSD@pandora.be>
List: netbsd-bugs
Date: 09/09/2007 10:30:02
The following reply was made to PR port-i386/36952; it has been noted by GNATS.

From: dieter roelants <dieter.NetBSD@pandora.be>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-i386/36952: swapctl(8) doesn't
Date: Sun, 9 Sep 2007 12:25:00 +0200

 On Sun,  9 Sep 2007 09:15:01 +0000 (UTC)
 jjhartley@gmail.com wrote:
 
 > $ sudo swapctl -A
 > Password:
 > swapctl: /dev/sd0b: Device busy
 > $ sudo swapctl -l
 > Device      512-blocks     Used    Avail Capacity  Priority
 > /dev/sd0b       262300   262288       12   100%    0
 > $ 
 
 Apparently, swapctl err's out on first failure. Anwyay, you can use
 swapctl -a /dev/sd1b for now.
 
 I propose this patch:
 
 --- swapctl.c   27 Aug 2006 21:07:39 -0000      1.32
 +++ swapctl.c   9 Sep 2007 10:18:46 -0000
 @@ -469,7 +469,8 @@ add_swap(char *path, int priority)
  
         if (swapctl(SWAP_ON, path, priority) < 0) {
  oops:
 -               err(1, "%s", path);
 +               warn("%s", path);
 +               return 0;
         }
         return (1);
  }
 
 Kind regards
 dieter