Skip to content

Commit

Permalink
tools: ynl-gen-c: don't require -o argument
Browse files Browse the repository at this point in the history
Without -o the tool currently crashes, but it's not marked
as required. The only thing we can't do without it is to
generate the correct #include for user source files, but
we can put a placeholder instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20241206113100.89d35bf124d6.I9228fb704e6d5c9d8e046ef15025a47a48439c1e@changeid
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Johannes Berg authored and Jakub Kicinski committed Dec 8, 2024
1 parent 00ab246 commit 81d89e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/net/ynl/ynl-gen-c.py
Original file line number Diff line number Diff line change
Expand Up @@ -2761,7 +2761,10 @@ def main():
cw.p('#define ' + hdr_prot)
cw.nl()

hdr_file=os.path.basename(args.out_file[:-2]) + ".h"
if args.out_file:
hdr_file = os.path.basename(args.out_file[:-2]) + ".h"
else:
hdr_file = "generated_header_file.h"

if args.mode == 'kernel':
cw.p('#include <net/netlink.h>')
Expand Down

0 comments on commit 81d89e6

Please sign in to comment.