usr.bin/undo: Fix error handling
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Mon, 28 Sep 2015 12:16:59 +0000 (21:16 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 10 Oct 2015 12:38:15 +0000 (21:38 +0900)
commit603468ea3430965b9ecd555406a8ae9ae597bf6d
treed8965e9f65eb7b8998d7a1d7462061747979bcc6
parent827bb21047a339b2336fd96a42f0f05689b5ca0d
usr.bin/undo: Fix error handling

As mentioned in the previous commit, collect_history() should
set error variable to errno when open(2) failed.

This commit does this by adding a new wrapper function for
collect_history() and renaming the existing collect_history()
to __collect_history(). The renamed collect_history() takes
const char* instead of fd and updates error if open(2) fails.

This is at least better although the error message changed
by the previous commit is still there without strerror().
usr.bin/undo/undo.c