]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/ctx.go
More descriptive error if spool does not exist
[nncp.git] / src / ctx.go
index 88fd852ecb17f1d6fdec67f199c6674e790d34d5..cb5c4282b868627e32691fe1e78aff346891bfa5 100644 (file)
@@ -36,6 +36,9 @@ type Ctx struct {
        Neigh  map[NodeId]*Node
        Alias  map[string]*NodeId
 
+       AreaId2Area map[AreaId]*Area
+       AreaName2Id map[string]*AreaId
+
        Spool      string
        LogPath    string
        UmaskForce *int
@@ -46,6 +49,9 @@ type Ctx struct {
        NotifyFile *FromToJSON
        NotifyFreq *FromToJSON
        NotifyExec map[string]*FromToJSON
+
+       MCDRxIfis []string
+       MCDTxIfis map[string]int
 }
 
 func (ctx *Ctx) FindNode(id string) (*Node, error) {
@@ -132,7 +138,7 @@ func CtxFromCmdline(
 func (ctx *Ctx) IsEnoughSpace(want int64) bool {
        var s unix.Statfs_t
        if err := unix.Statfs(ctx.Spool, &s); err != nil {
-               log.Fatalln(err)
+               log.Fatalln("Can not stat spool:", err)
        }
        return int64(s.Bavail)*int64(s.Bsize) > want
 }