fun padBy ch amt s =
if size s < amt then
- CharVector.tabulate (amt, fn _ => ch) ^ s
+ CharVector.tabulate (amt - size s, fn _ => ch) ^ s
else
s
val min = readILine inf
val () = TextIO.closeIn inf
+ val serialPath = OS.Path.joinDirFile {dir = Config.serialDir,
+ file = #domain fs}
+
val oldSerial = let
- val inf = TextIO.openIn (OS.Path.joinDirFile {dir = #dir fs,
- file = "serial"})
+ val inf = TextIO.openIn serialPath
in
SOME (readLine inf)
before TextIO.closeIn inf
- end handle IO.Io _ => NONE
+ end handle IO.Io {name, ...} => NONE
val newSerial =
case serial of
"00")
end
- val outf = TextIO.openOut (OS.Path.joinDirFile {dir = #dir fs,
- file = "serial"})
+ val outf = TextIO.openOut serialPath
val _ = TextIO.output (outf, newSerial)
val _ = TextIO.closeOut outf
fn cl => "Error reloading bind with " ^ cl)
else
()))
+
+val () = Domain.registerResetLocal (fn () =>
+ ignore (OS.Process.system (Config.rm ^ " -rf /var/domtool/zones/*")))
+
end