[longbow-project] [PATCH] Added value-error catching inside gen_syscalls_h.py while converting the interrupt-number.

  • From: Kevin Trogant <greenfoxlight.42@xxxxxxxxx>
  • To: longbow-project@xxxxxxxxxxxxx
  • Date: Fri, 22 May 2015 18:11:16 +0200

---
util/gen_syscalls_h/gen_syscalls_h.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/util/gen_syscalls_h/gen_syscalls_h.py
b/util/gen_syscalls_h/gen_syscalls_h.py
index 35827f4..bf3128f 100755
--- a/util/gen_syscalls_h/gen_syscalls_h.py
+++ b/util/gen_syscalls_h/gen_syscalls_h.py
@@ -81,7 +81,12 @@ def parse_syscall(filename, lines, verbose):
elif len(args) > 3:
print("[Warning] Too much arguments for SYSCALL in file: \"" +
filename + "\"")
print(" Line: " + line)
- number = int(args[0].strip())
+ try:
+ number = int(args[0].strip())
+ except ValueError:
+ print("[Error] Invalid syscall number in file \"" + filename +
"\"")
+ print(" Line: " + line)
+ return
name = args[1].strip()
return_type = args[2].strip()
if verbose:
--
2.3.6


Other related posts:

  • » [longbow-project] [PATCH] Added value-error catching inside gen_syscalls_h.py while converting the interrupt-number. - Kevin Trogant