aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2023-08-13 13:59:58 +0100
committerGrégoire Duchêne <gduchene@awhk.org>2023-08-13 13:59:58 +0100
commit07276515b0593331720ee4fe307b65d5cfeb7cbf (patch)
tree05225ddc07965d3773eb26b796d93ce638fa6e42
parent1b3667a9b3c038c6c501f229b6c7ea2b77ed7698 (diff)
Close configuration file after loading it
-rw-r--r--main.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.go b/main.go
index 5a000b3..b1a29a1 100644
--- a/main.go
+++ b/main.go
@@ -34,6 +34,9 @@ func main() {
if err != nil {
log.Fatalf("Could not load the configuration: %v.", err)
}
+ if err := fd.Close(); err != nil {
+ log.Printf("Failed to close configuration file: %v.", err)
+ }
done := make(chan os.Signal, 1)
signal.Notify(done, os.Interrupt, unix.SIGTERM)