diff options
author | FRIGN <dev@frign.de> | 2016-08-22 00:25:21 +0200 |
---|---|---|
committer | Markus Teich <markus.teich@stusta.mhn.de> | 2016-08-22 23:22:20 +0200 |
commit | 3bb868e40873c568acdec74f7783c77f063aa396 (patch) | |
tree | 2f6f2406770cb9e5795832dcace37ac536469341 /explicit_bzero.c | |
parent | a7afade1701a809f6a33b53525d59dd29b38d381 (diff) | |
download | slock-3bb868e40873c568acdec74f7783c77f063aa396.tar.gz slock-3bb868e40873c568acdec74f7783c77f063aa396.tar.xz |
Refactor main()
- Add arg.h and fix usage
Given slock is suid we don't want to have half-measures in place to
parse the arguments in case the code is changed in the future with
somebody not paying enough attention.
Also, fix the usage string output to be more consistent across the
suckless toolbase and make it reflect the manpage entry.
- Comments
Use proper block comments and add/change them where necessary
to help in studying the code.
- Error messages
Consistently prepend them with "slock:" and fix wording and
do a proper cleanup before quitting (XCloseDisplay and free
the locks), making the die() semantics consistent with st's.
- getpwuid() error reporting
Properly present an error message if getpwuid() fails.
- fork() error reporting
Properly present an error message if fork() fails. If we cannot
close the connection within the fork context we abort the
operation and report an error.
- execvp() error handling
If execvp fails, we cannot call die() afterwards as this implies
calling exit(). We must use _exit() to prevent the libc from
doing now "illegal" cleanup-work.
Diffstat (limited to 'explicit_bzero.c')
0 files changed, 0 insertions, 0 deletions