Skip to content

Commit

Permalink
Be silence if the kernel arg is not found
Browse files Browse the repository at this point in the history
Fix #89
  • Loading branch information
chenchun committed Nov 6, 2020
1 parent c73486a commit db58ea7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/network/kernel/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package kernel

import (
"io/ioutil"
"os"
"syscall"
"time"

Expand Down Expand Up @@ -58,7 +59,7 @@ func setArg(expect string, file string, quit <-chan struct{}) {
}
if string(data) != expect+"\n" {
glog.Warningf("%s unset, setting it", file)
if err := ioutil.WriteFile(file, []byte(expect), 0644); err != nil {
if err := ioutil.WriteFile(file, []byte(expect), 0644); err != nil && !os.IsNotExist(err) {
glog.Warningf("Error set kernel args %s: %v", file, err)
}
}
Expand Down

0 comments on commit db58ea7

Please sign in to comment.