aboutsummaryrefslogtreecommitdiff
path: root/win32/process.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-12-09 14:04:58 +0000
committerRon Yorston <rmy@pobox.com>2018-12-09 14:22:32 +0000
commit3a975bd37b82a6e66a2cd5977544b03a6b24ce70 (patch)
tree24bf2f6cef03eeb84d2397868bbe50ff7bb08f56 /win32/process.c
parent44477db354f67c4eacfced89fac5fbf3dbeaa3ff (diff)
downloadbusybox-w32-3a975bd37b82a6e66a2cd5977544b03a6b24ce70.tar.gz
busybox-w32-3a975bd37b82a6e66a2cd5977544b03a6b24ce70.tar.bz2
busybox-w32-3a975bd37b82a6e66a2cd5977544b03a6b24ce70.zip
win32: use open_read_close() where possible
Diffstat (limited to 'win32/process.c')
-rw-r--r--win32/process.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/win32/process.c b/win32/process.c
index f059bee18..20e73baee 100644
--- a/win32/process.c
+++ b/win32/process.c
@@ -55,13 +55,9 @@ static int
55parse_interpreter(const char *cmd, interp_t *interp) 55parse_interpreter(const char *cmd, interp_t *interp)
56{ 56{
57 char *path, *t; 57 char *path, *t;
58 int n, fd; 58 int n;
59 59
60 fd = open(cmd, O_RDONLY); 60 n = open_read_close(cmd, interp->buf, sizeof(interp->buf)-1);
61 if (fd < 0)
62 return 0;
63 n = read(fd, interp->buf, sizeof(interp->buf)-1);
64 close(fd);
65 if (n < 4) /* at least '#!/x' and not error */ 61 if (n < 4) /* at least '#!/x' and not error */
66 return 0; 62 return 0;
67 63