diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-11-11 10:29:56 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-11-11 10:29:56 -0800 |
| commit | b2f4d849850052ad7915771397396c60c2e0ad9e (patch) | |
| tree | 248b0c5587e237b3a70040b94834ea57e2c4462f /bb.c | |
| parent | 000b652ac011b5c71dcfd711f99c70cc20891953 (diff) | |
Added error checks
Diffstat (limited to 'bb.c')
| -rw-r--r-- | bb.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -665,12 +665,13 @@ void run_bbcmd(bb_t *bb, const char *cmd) } else if (matches_cmd(cmd, "help")) { // +help char filename[256] = "/tmp/bbhelp.XXXXXX"; int fd = mkostemp(filename, O_WRONLY); + if (fd == -1) err("Couldn't create temporary help file in /tmp/"); print_bindings(fd); close(fd); char script[512] = "less -rKX < "; strcat(script, filename); run_script(bb, script); - unlink(filename); + if (unlink(filename) == -1) err("Couldn't delete temporary help file: '%s'", filename); } else if (matches_cmd(cmd, "interleave:") || matches_cmd(cmd, "interleave")) { // +interleave set_bool(bb->interleave_dirs); sort_files(bb); |
