Skip to content

Commit

Permalink
Minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
WessellUrdata committed Jan 20, 2025
1 parent f6da69a commit f07f355
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patch-vbmeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def patch_vbmeta(file):
magic = os.read(fd, AVB_MAGIC_LEN)

if magic != AVB_MAGIC:
fd.close()
os.close(fd)
sys.exit(
"Error: The provided image is not a valid vbmeta image.\nFile not modified. Exiting..."
)
Expand All @@ -34,7 +34,7 @@ def patch_vbmeta(file):
os.lseek(fd, FLAGS_OFFSET, os.SEEK_SET)
os.write(fd, FLAGS_TO_SET)
except OSError:
fd.close()
os.close(fd)
sys.exit("Error: Failed when patching the vbmeta image.\nExiting...")

# end of program
Expand Down

0 comments on commit f07f355

Please sign in to comment.