summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-09-07 19:17:03 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-09-07 19:17:03 -0700
commit9fac1a7afcbf94dcd3092b5bb519a3c2dd7032ea (patch)
tree92cad3d94819f76168af7dd38403c815488cc84a /utils
parentd9321cea89ddf163ca8e2661474714a73b541acd (diff)
downloadsyslinux-9fac1a7afcbf94dcd3092b5bb519a3c2dd7032ea.tar.gz
isohybrid, mkdiskimage: don't use sysopen(), sysread()
Don't use sysopen() and sysread() when it doesn't make sense. Especially avoid using sysread() -- sysopen() can be used with read(); the C fdopen() is implicit. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/isohybrid.in3
-rw-r--r--utils/mkdiskimage.in3
2 files changed, 2 insertions, 4 deletions
diff --git a/utils/isohybrid.in b/utils/isohybrid.in
index 5e3f785a..1dcdf10e 100644
--- a/utils/isohybrid.in
+++ b/utils/isohybrid.in
@@ -31,8 +31,7 @@ sub get_random() {
my $rfd, $rnd;
my $rid;
- if (sysopen($rfd, '/dev/urandom', O_RDONLY) &&
- sysread($rfd, $rnd, 4) == 4) {
+ if (open($rfd, "< /dev/urandom\0") && read($rfd, $rnd, 4) == 4) {
$rid = unpack("V", $rnd);
}
diff --git a/utils/mkdiskimage.in b/utils/mkdiskimage.in
index f66ad7cf..1ce8b64f 100644
--- a/utils/mkdiskimage.in
+++ b/utils/mkdiskimage.in
@@ -44,8 +44,7 @@ sub get_random() {
my $rfd, $rnd;
my $rid;
- if (sysopen($rfd, '/dev/urandom', O_RDONLY) &&
- sysread($rfd, $rnd, 4) == 4) {
+ if (open($rfd, "< /dev/urandom\0") && read($rfd, $rnd, 4) == 4) {
$rid = unpack("V", $rnd);
}