diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-09-07 19:17:03 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-09-07 19:17:03 -0700 |
commit | 9fac1a7afcbf94dcd3092b5bb519a3c2dd7032ea (patch) | |
tree | 92cad3d94819f76168af7dd38403c815488cc84a /utils | |
parent | d9321cea89ddf163ca8e2661474714a73b541acd (diff) | |
download | syslinux-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.in | 3 | ||||
-rw-r--r-- | utils/mkdiskimage.in | 3 |
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); } |