diff options
author | P. J. McDermott <pj@pehjota.net> | 2016-01-17 14:39:36 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2016-01-17 14:39:36 (EST) |
commit | d47c3f687284a3a21ceb9db3ae6748f00bab5d40 (patch) | |
tree | a217a8e315526f5655ebdc491bcf6d7e46bac499 /src | |
parent | 67081a93e36b1b8b87dbc39e3256a51e63f66f3f (diff) |
fopen(), fclose(): Use non-exiting error()
Diffstat (limited to 'src')
-rw-r--r-- | src/fd.sh | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -63,8 +63,8 @@ fopen() i=$(($i + 1)) done if [ "x${fd:+set}" != 'xset' ]; then - error 2 "$(get_msg 'emfile')" - return + error "$(get_msg 'emfile')" + return 1 fi if eval "exec ${fd}${mode}'${path}'"; then @@ -72,7 +72,8 @@ fopen() FD="${fd}" return 0 else - error 2 "$(get_msg 'cant_fopen')" + error "$(get_msg 'cant_fopen')" + return 1 fi } @@ -82,7 +83,8 @@ fclose() # Make sure the file descriptor is open. if [ "x$(eval echo "\${_fd_${fd}+set}")" != 'xset' ]; then - error 2 "$(get_msg 'ebadf')" + error "$(get_msg 'ebadf')" + return 1 fi eval "exec ${fd}>&-" |