]> git.ipfire.org Git - thirdparty/systemd.git/commit
basic/fileio: clean up executable_is_script() a bit 35559/head
authorMike Yuan <me@yhndnzj.com>
Tue, 10 Dec 2024 15:14:34 +0000 (16:14 +0100)
committerMike Yuan <me@yhndnzj.com>
Wed, 11 Dec 2024 18:11:22 +0000 (19:11 +0100)
commitad9a66fee8f370b7cc5c491bccb971d9d63129f5
tree5907afb06fa5706e5044426619b7a52d9f2cd6fb
parentc0cf1c58268acf5eb5fac76866875c4a9abfce83
basic/fileio: clean up executable_is_script() a bit

- Rename to script_get_shebang_interpreter and return
  -EMEDIUMTYPE if the executable is not a script.
  We nowadays utilize the scheme of making ret param
  of getters optional, and use them directly as checkers.
- Don't unnecessarily read the whole line, but check
  only the shebang first.
src/basic/fileio.c
src/basic/fileio.h
src/journal/journalctl-filter.c
src/test/test-fileio.c