X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fjobs.go;h=05a7c9c66c91cee809e3cafc9fe8a0caea056a41;hb=HEAD;hp=7e920fd5c60182609008e3b2457ab32324bba17c;hpb=0639e0c1eb295d1a8e2be31c906ee22394a51d20;p=nncp.git diff --git a/src/jobs.go b/src/jobs.go index 7e920fd..ff2977b 100644 --- a/src/jobs.go +++ b/src/jobs.go @@ -1,6 +1,6 @@ /* NNCP -- Node to Node copy, utilities for store-and-forward data exchange -Copyright (C) 2016-2021 Sergey Matveev +Copyright (C) 2016-2023 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,8 +19,10 @@ package nncp import ( "bytes" + "errors" "fmt" "io" + "io/fs" "os" "path/filepath" "strings" @@ -148,7 +150,7 @@ func (ctx *Ctx) jobsFind(nodeId *NodeId, xx TRxTx, nock, part bool) chan Job { fd, err = os.Open(pth) } else { fd, err = os.Open(JobPath2Hdr(pth)) - if err != nil && os.IsNotExist(err) { + if err != nil && errors.Is(err, fs.ErrNotExist) { hdrExists = false fd, err = os.Open(pth) } @@ -181,6 +183,8 @@ func (ctx *Ctx) jobsFind(nodeId *NodeId, xx TRxTx, nock, part bool) chan Job { case MagicNNCPEv4.B: err = MagicNNCPEv4.TooOld() case MagicNNCPEv5.B: + err = MagicNNCPEv5.TooOld() + case MagicNNCPEv6.B: default: err = BadMagic }