carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package hostbox
2
3import (
4 "errors"
5 "os"
6)
7
8func checkJournalPath(path string) error {
9 for _, suffix := range []string{"", "-wal", "-shm"} {
10 info, err := os.Lstat(path + suffix)
11 if errors.Is(err, os.ErrNotExist) {
12 continue
13 }
14 if err != nil {
15 return err
16 }
17 if !info.Mode().IsRegular() {
18 return ErrTypedInventory
19 }
20 }
21 return nil
22}
23