summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2016-01-17 14:38:12 (EST)
committer P. J. McDermott <pj@pehjota.net>2016-01-17 14:38:12 (EST)
commit67081a93e36b1b8b87dbc39e3256a51e63f66f3f (patch)
tree77658706b47d9c6062512c856ce7e4af49b601b0 /src
parentb11aa3630336cf12b3760e9fa3e6bf8a567ce898 (diff)
install_*_pkgs(): Check return value of fopen()
Diffstat (limited to 'src')
-rw-r--r--src/install.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/install.sh b/src/install.sh
index f060b92..edd5c95 100644
--- a/src/install.sh
+++ b/src/install.sh
@@ -101,7 +101,9 @@ install_find_pkgs()
local pkgs=
mkdir -p "${root}/etc/opkg" "${root}/var/lib/opkg/lists"
- fopen "${root}/etc/opkg/opkg.conf" 'w'
+ if ! fopen "${root}/etc/opkg/opkg.conf" 'w'; then
+ return 1
+ fi
opkg_conf_fd=${FD}
install_deps=
@@ -109,7 +111,9 @@ install_find_pkgs()
install_md5sums=
install_sha256sums=
- fopen "${root}/.prokit/packages" 'w'
+ if ! fopen "${root}/.prokit/packages" 'w'; then
+ return 1
+ fi
pkgs_fd=${FD}
while read -r opt feed_idx feed; do
@@ -203,7 +207,9 @@ install_get_pkgs()
mkdir -p "${root}/var/cache/opkg/archives" "${root}/tmp/opkg" \
"${root}/var/lib/opkg/info"
- fopen "${root}/var/lib/opkg/status" 'w'
+ if ! fopen "${root}/var/lib/opkg/status" 'w'; then
+ return 1
+ fi
status_fd=${FD}
for pkg in $(cat "${root}/.prokit/packages"); do