fix: Make inittab parse if error was nil

This commit is contained in:
ptrcnull 2021-11-29 23:08:10 +01:00
parent 068cb742f5
commit e8591c5770
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@ import (
func main() {
inittab := DefaultInitTab
if file, err := os.OpenFile("/etc/inittab", os.O_RDONLY, 0644); err != nil {
if file, err := os.OpenFile("/etc/inittab", os.O_RDONLY, 0644); err == nil {
inittab = ParseInitTab(file)
err := file.Close()
if err != nil {