aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-06-07 09:01:57 +0100
committerRon Yorston <rmy@pobox.com>2021-06-07 11:30:37 +0100
commitcdd0e9946a45dd69dc0bc8a8d0bcb734c7234937 (patch)
tree298423a59df4c51461e708008ca15461fb9a403a
parentaef29667bf794761a76d7c744e1e434f744e0b9b (diff)
downloadbusybox-w32-cdd0e9946a45dd69dc0bc8a8d0bcb734c7234937.tar.gz
busybox-w32-cdd0e9946a45dd69dc0bc8a8d0bcb734c7234937.tar.bz2
busybox-w32-cdd0e9946a45dd69dc0bc8a8d0bcb734c7234937.zip
win32: rename update_dev_fd() as update_special_fd()
Avoid confusion between special devices and /dev/fd.
-rw-r--r--coreutils/dd.c2
-rw-r--r--include/mingw.h2
-rw-r--r--win32/mingw.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c
index 15938f689..b476ed24f 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -511,7 +511,7 @@ int dd_main(int argc UNUSED_PARAM, char **argv)
511#endif 511#endif
512 xmove_fd(MINGW_SPECIAL(xopen)(infile, iflag), ifd); 512 xmove_fd(MINGW_SPECIAL(xopen)(infile, iflag), ifd);
513#if ENABLE_PLATFORM_MINGW32 513#if ENABLE_PLATFORM_MINGW32
514 update_dev_fd(get_dev_type(infile), ifd); 514 update_special_fd(get_dev_type(infile), ifd);
515#endif 515#endif
516 } else { 516 } else {
517 infile = bb_msg_standard_input; 517 infile = bb_msg_standard_input;
diff --git a/include/mingw.h b/include/mingw.h
index 89b26762a..367aa7cdc 100644
--- a/include/mingw.h
+++ b/include/mingw.h
@@ -453,7 +453,7 @@ NOIMPL(mknod,const char *name UNUSED_PARAM, mode_t mode UNUSED_PARAM, dev_t devi
453/* order of devices must match that in get_dev_type */ 453/* order of devices must match that in get_dev_type */
454enum {DEV_NULL, DEV_ZERO, DEV_URANDOM, NOT_DEVICE = -1}; 454enum {DEV_NULL, DEV_ZERO, DEV_URANDOM, NOT_DEVICE = -1};
455int get_dev_type(const char *filename); 455int get_dev_type(const char *filename);
456void update_dev_fd(int dev, int fd); 456void update_special_fd(int dev, int fd);
457int mingw_open (const char *filename, int oflags, ...); 457int mingw_open (const char *filename, int oflags, ...);
458 458
459/* functions which add O_SPECIAL to open(2) to allow access to devices */ 459/* functions which add O_SPECIAL to open(2) to allow access to devices */
diff --git a/win32/mingw.c b/win32/mingw.c
index 182e3d4db..11ae09043 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -177,7 +177,7 @@ int get_dev_type(const char *filename)
177 return NOT_DEVICE; 177 return NOT_DEVICE;
178} 178}
179 179
180void update_dev_fd(int dev, int fd) 180void update_special_fd(int dev, int fd)
181{ 181{
182 if (dev == DEV_ZERO) 182 if (dev == DEV_ZERO)
183 zero_fd = fd; 183 zero_fd = fd;
@@ -206,7 +206,7 @@ int mingw_open (const char *filename, int oflags, ...)
206 206
207 fd = open(filename, oflags&~O_SPECIAL, mode); 207 fd = open(filename, oflags&~O_SPECIAL, mode);
208 if (fd >= 0) { 208 if (fd >= 0) {
209 update_dev_fd(dev, fd); 209 update_special_fd(dev, fd);
210 } 210 }
211 else if ((oflags & O_ACCMODE) != O_RDONLY && errno == EACCES) { 211 else if ((oflags & O_ACCMODE) != O_RDONLY && errno == EACCES) {
212 DWORD attrs = GetFileAttributes(filename); 212 DWORD attrs = GetFileAttributes(filename);