From 5c770c843135040655925283c55c9163cd2c1052 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sun, 28 Sep 2003 09:44:13 +0000 Subject: [PATCH] * devices.h: Move a few device major numbers. Fix typo of FH_UDP. * device.shilka: Remove /dev/hd device entries, rename all device_hd* to device_sd*. (device::parse): Disallow units outside lower and upper bounds. * dtable.cc (build_fh_pc): Fix typo of FH_UDP. * path.cc (win32_device_name): Fix win32 name creation to match new device handling. --- winsup/cygwin/ChangeLog | 10 + winsup/cygwin/devices.cc | 902 +++++++++++------------------------ winsup/cygwin/devices.h | 10 +- winsup/cygwin/devices.shilka | 186 ++++---- winsup/cygwin/dtable.cc | 2 +- winsup/cygwin/path.cc | 12 +- 6 files changed, 370 insertions(+), 752 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e8185946e..83c19a2ed 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,13 @@ +2003-09-28 Corinna Vinschen + + * devices.h: Move a few device major numbers. Fix typo of FH_UDP. + * device.shilka: Remove /dev/hd device entries, rename all device_hd* + to device_sd*. + (device::parse): Disallow units outside lower and upper bounds. + * dtable.cc (build_fh_pc): Fix typo of FH_UDP. + * path.cc (win32_device_name): Fix win32 name creation to match new + device handling. + 2003-09-27 Christopher Faylor * device.shilka (device::parse): Allow units on other than tty. diff --git a/winsup/cygwin/devices.cc b/winsup/cygwin/devices.cc index b9550de55..0131b3160 100644 --- a/winsup/cygwin/devices.cc +++ b/winsup/cygwin/devices.cc @@ -34,7 +34,7 @@ const device dev_tcp_storage = {"/dev/inet/tcp", FH_TCP, "", 0, 0, 0, 0}; const device dev_udp_storage = - {"/dev/inet/udp", FH_UCP, "", 0, 0, 0, 0}; + {"/dev/inet/udp", FH_UDP, "", 0, 0, 0, 0}; const device dev_icmp_storage = {"/dev/inet/icmp", FH_ICMP, "", 0, 0, 0, 0}; @@ -132,83 +132,83 @@ const device dev_cdrom_storage = const device dev_sr_storage = {"/dev/sr", FH_CDROM, "\\Device\\CdRom%d", 0, 15}; -const device dev_hda_storage = -{"/dev/hda", FH_SDA, "\\Device\\Harddisk%d\\Partition%d", 1, 16, -1}; +const device dev_sda_storage = +{"/dev/sda", FH_SDA, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 0}; -const device dev_hdb_storage = -{"/dev/hdb", FH_SDB, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 15}; +const device dev_sdb_storage = +{"/dev/sdb", FH_SDB, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 16}; -const device dev_hdc_storage = -{"/dev/hdc", FH_SDC, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 31}; +const device dev_sdc_storage = +{"/dev/sdc", FH_SDC, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 32}; -const device dev_hdd_storage = -{"/dev/hdd", FH_SDD, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 47}; +const device dev_sdd_storage = +{"/dev/sdd", FH_SDD, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 48}; -const device dev_hde_storage = -{"/dev/hde", FH_SDE, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 63}; +const device dev_sde_storage = +{"/dev/sde", FH_SDE, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 64}; -const device dev_hdf_storage = -{"/dev/hdf", FH_SDF, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 79}; +const device dev_sdf_storage = +{"/dev/sdf", FH_SDF, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 80}; -const device dev_hdg_storage = -{"/dev/hdg", FH_SDG, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 95}; +const device dev_sdg_storage = +{"/dev/sdg", FH_SDG, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 96}; -const device dev_hdh_storage = -{"/dev/hdh", FH_SDH, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 111}; +const device dev_sdh_storage = +{"/dev/sdh", FH_SDH, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 112}; -const device dev_hdi_storage = -{"/dev/hdi", FH_SDI, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 127}; +const device dev_sdi_storage = +{"/dev/sdi", FH_SDI, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 128}; -const device dev_hdj_storage = -{"/dev/hdj", FH_SDJ, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 143}; +const device dev_sdj_storage = +{"/dev/sdj", FH_SDJ, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 144}; -const device dev_hdk_storage = -{"/dev/hdk", FH_SDK, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 159}; +const device dev_sdk_storage = +{"/dev/sdk", FH_SDK, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 160}; -const device dev_hdl_storage = -{"/dev/hdl", FH_SDL, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 175}; +const device dev_sdl_storage = +{"/dev/sdl", FH_SDL, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 176}; -const device dev_hdm_storage = -{"/dev/hdm", FH_SDM, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 191}; +const device dev_sdm_storage = +{"/dev/sdm", FH_SDM, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 192}; -const device dev_hdn_storage = -{"/dev/hdn", FH_SDN, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 207}; +const device dev_sdn_storage = +{"/dev/sdn", FH_SDN, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 208}; -const device dev_hdo_storage = -{"/dev/hdo", FH_SDO, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 223}; +const device dev_sdo_storage = +{"/dev/sdo", FH_SDO, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 224}; -const device dev_hdp_storage = -{"/dev/hdp", FH_SDP, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 239}; +const device dev_sdp_storage = +{"/dev/sdp", FH_SDP, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 240}; -const device dev_hdq_storage = -{"/dev/hdq", FH_SDQ, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 255 /* FIXME 8 bit lunacy */}; +const device dev_sdq_storage = +{"/dev/sdq", FH_SDQ, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 256}; -const device dev_hdr_storage = -{"/dev/hdr", FH_SDR, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 271}; +const device dev_sdr_storage = +{"/dev/sdr", FH_SDR, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 272}; -const device dev_hds_storage = -{"/dev/hds", FH_SDS, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 287}; +const device dev_sds_storage = +{"/dev/sds", FH_SDS, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 288}; -const device dev_hdt_storage = -{"/dev/hdt", FH_SDT, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 303}; +const device dev_sdt_storage = +{"/dev/sdt", FH_SDT, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 304}; -const device dev_hdu_storage = -{"/dev/hdu", FH_SDU, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 319}; +const device dev_sdu_storage = +{"/dev/sdu", FH_SDU, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 320}; -const device dev_hdv_storage = -{"/dev/hdv", FH_SDV, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 335}; +const device dev_sdv_storage = +{"/dev/sdv", FH_SDV, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 336}; -const device dev_hdw_storage = -{"/dev/hdw", FH_SDW, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 351}; +const device dev_sdw_storage = +{"/dev/sdw", FH_SDW, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 352}; -const device dev_hdx_storage = -{"/dev/hdx", FH_SDX, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 367}; +const device dev_sdx_storage = +{"/dev/sdx", FH_SDX, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 368}; -const device dev_hdy_storage = -{"/dev/hdy", FH_SDY, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 383}; +const device dev_sdy_storage = +{"/dev/sdy", FH_SDY, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 384}; -const device dev_hdz_storage = -{"/dev/hdz", FH_SDZ, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 399}; +const device dev_sdz_storage = +{"/dev/sdz", FH_SDZ, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 400}; const device dev_rawdrive_storage = {"/dev/rawdrive", FH_RAWDRIVE, "\\DosDevices\\%c:", 0, 0, 0, 0}; @@ -319,415 +319,31 @@ return NULL; } } case 8: - switch (KR_keyword [5]) - { - case 't': - if (strncmp (KR_keyword, "/dev/tty", 8) == 0) - { -{ -return &dev_tty_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 's': - switch (KR_keyword [7]) - { - case 'z': - if (strncmp (KR_keyword, "/dev/sdz", 8) == 0) - { -{ -return &dev_hdz_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'y': - if (strncmp (KR_keyword, "/dev/sdy", 8) == 0) - { -{ -return &dev_hdy_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'x': - if (strncmp (KR_keyword, "/dev/sdx", 8) == 0) - { -{ -return &dev_hdx_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'w': - if (strncmp (KR_keyword, "/dev/sdw", 8) == 0) - { -{ -return &dev_hdw_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'v': - if (strncmp (KR_keyword, "/dev/sdv", 8) == 0) - { -{ -return &dev_hdv_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'u': - if (strncmp (KR_keyword, "/dev/sdu", 8) == 0) - { -{ -return &dev_hdu_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 't': - if (strncmp (KR_keyword, "/dev/sdt", 8) == 0) - { -{ -return &dev_hdt_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 's': - if (strncmp (KR_keyword, "/dev/sds", 8) == 0) - { -{ -return &dev_hds_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'r': - if (strncmp (KR_keyword, "/dev/sdr", 8) == 0) - { -{ -return &dev_hdr_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'q': - if (strncmp (KR_keyword, "/dev/sdq", 8) == 0) - { -{ -return &dev_hdq_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'p': - if (strncmp (KR_keyword, "/dev/sdp", 8) == 0) - { -{ -return &dev_hdp_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'o': - if (strncmp (KR_keyword, "/dev/sdo", 8) == 0) - { -{ -return &dev_hdo_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'n': - if (strncmp (KR_keyword, "/dev/sdn", 8) == 0) - { -{ -return &dev_hdn_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'm': - if (strncmp (KR_keyword, "/dev/sdm", 8) == 0) - { -{ -return &dev_hdm_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'l': - if (strncmp (KR_keyword, "/dev/sdl", 8) == 0) - { -{ -return &dev_hdl_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'k': - if (strncmp (KR_keyword, "/dev/sdk", 8) == 0) - { -{ -return &dev_hdk_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'j': - if (strncmp (KR_keyword, "/dev/sdj", 8) == 0) - { -{ -return &dev_hdj_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'i': - if (strncmp (KR_keyword, "/dev/sdi", 8) == 0) - { -{ -return &dev_hdi_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'h': - if (strncmp (KR_keyword, "/dev/sdh", 8) == 0) - { -{ -return &dev_hdh_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'g': - if (strncmp (KR_keyword, "/dev/sdg", 8) == 0) - { -{ -return &dev_hdg_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'f': - if (strncmp (KR_keyword, "/dev/sdf", 8) == 0) - { -{ -return &dev_hdf_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'e': - if (strncmp (KR_keyword, "/dev/sde", 8) == 0) - { -{ -return &dev_hde_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'd': - switch (KR_keyword [6]) - { - case 'd': - if (strncmp (KR_keyword, "/dev/sdd", 8) == 0) - { -{ -return &dev_hdd_storage; - -} - } - else - { -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/scd", 8) == 0) - { -{ -return &dev_cdrom_storage; - -} - } - else - { -{ -return NULL; - -} - } - default: -{ -return NULL; - -} - } - case 'c': - if (strncmp (KR_keyword, "/dev/sdc", 8) == 0) - { + switch (KR_keyword [7]) + { + case 'z': + if (strncmp (KR_keyword, "/dev/sdz", 8) == 0) + { { -return &dev_hdc_storage; +return &dev_sdz_storage; } - } - else - { + } + else + { { return NULL; } - } - case 'b': - if (strncmp (KR_keyword, "/dev/sdb", 8) == 0) + } + case 'y': + switch (KR_keyword [5]) + { + case 't': + if (strncmp (KR_keyword, "/dev/tty", 8) == 0) { { -return &dev_hdb_storage; +return &dev_tty_storage; } } @@ -738,11 +354,11 @@ return NULL; } } - case 'a': - if (strncmp (KR_keyword, "/dev/sda", 8) == 0) + case 's': + if (strncmp (KR_keyword, "/dev/sdy", 8) == 0) { { -return &dev_hda_storage; +return &dev_sdy_storage; } } @@ -759,11 +375,11 @@ return NULL; } } - case 'n': - if (strncmp (KR_keyword, "/dev/nst", 8) == 0) + case 'x': + if (strncmp (KR_keyword, "/dev/sdx", 8) == 0) { { -return &dev_nst_storage; +return &dev_sdx_storage; } } @@ -774,11 +390,11 @@ return NULL; } } - case 'm': - if (strncmp (KR_keyword, "/dev/mem", 8) == 0) + case 'w': + if (strncmp (KR_keyword, "/dev/sdw", 8) == 0) { { -return &dev_mem_storage; +return &dev_sdw_storage; } } @@ -789,44 +405,44 @@ return NULL; } } - case 'h': - switch (KR_keyword [7]) + case 'v': + if (strncmp (KR_keyword, "/dev/sdv", 8) == 0) { - case 'z': - if (strncmp (KR_keyword, "/dev/hdz", 8) == 0) - { { -return &dev_hdz_storage; +return &dev_sdv_storage; } - } - else - { + } + else + { { return NULL; } - } - case 'y': - if (strncmp (KR_keyword, "/dev/hdy", 8) == 0) - { + } + case 'u': + if (strncmp (KR_keyword, "/dev/sdu", 8) == 0) + { { -return &dev_hdy_storage; +return &dev_sdu_storage; } - } - else - { + } + else + { { return NULL; } - } - case 'x': - if (strncmp (KR_keyword, "/dev/hdx", 8) == 0) + } + case 't': + switch (KR_keyword [5]) + { + case 's': + if (strncmp (KR_keyword, "/dev/sdt", 8) == 0) { { -return &dev_hdx_storage; +return &dev_sdt_storage; } } @@ -837,11 +453,11 @@ return NULL; } } - case 'w': - if (strncmp (KR_keyword, "/dev/hdw", 8) == 0) + case 'n': + if (strncmp (KR_keyword, "/dev/nst", 8) == 0) { { -return &dev_hdw_storage; +return &dev_nst_storage; } } @@ -852,56 +468,65 @@ return NULL; } } - case 'v': - if (strncmp (KR_keyword, "/dev/hdv", 8) == 0) - { + default: { -return &dev_hdv_storage; +return NULL; } - } - else - { + } + case 's': + if (strncmp (KR_keyword, "/dev/sds", 8) == 0) + { +{ +return &dev_sds_storage; + +} + } + else + { { return NULL; } - } - case 'u': - if (strncmp (KR_keyword, "/dev/hdu", 8) == 0) - { + } + case 'r': + if (strncmp (KR_keyword, "/dev/sdr", 8) == 0) + { { -return &dev_hdu_storage; +return &dev_sdr_storage; } - } - else - { + } + else + { { return NULL; } - } - case 't': - if (strncmp (KR_keyword, "/dev/hdt", 8) == 0) - { + } + case 'q': + if (strncmp (KR_keyword, "/dev/sdq", 8) == 0) + { { -return &dev_hdt_storage; +return &dev_sdq_storage; } - } - else - { + } + else + { { return NULL; } - } + } + case 'p': + switch (KR_keyword [5]) + { case 's': - if (strncmp (KR_keyword, "/dev/hds", 8) == 0) + if (strncmp (KR_keyword, "/dev/sdp", 8) == 0) { { -return &dev_hds_storage; +return &dev_sdp_storage; } } @@ -912,11 +537,11 @@ return NULL; } } - case 'r': - if (strncmp (KR_keyword, "/dev/hdr", 8) == 0) + case 'd': + if (strncmp (KR_keyword, "/dev/dsp", 8) == 0) { { -return &dev_hdr_storage; +return &dev_oss_dsp_storage; } } @@ -927,56 +552,50 @@ return NULL; } } - case 'q': - if (strncmp (KR_keyword, "/dev/hdq", 8) == 0) - { -{ -return &dev_hdq_storage; - -} - } - else - { + default: { return NULL; } - } - case 'p': - if (strncmp (KR_keyword, "/dev/hdp", 8) == 0) - { + } + case 'o': + if (strncmp (KR_keyword, "/dev/sdo", 8) == 0) + { { -return &dev_hdp_storage; +return &dev_sdo_storage; } - } - else - { + } + else + { { return NULL; } - } - case 'o': - if (strncmp (KR_keyword, "/dev/hdo", 8) == 0) - { + } + case 'n': + if (strncmp (KR_keyword, "/dev/sdn", 8) == 0) + { { -return &dev_hdo_storage; +return &dev_sdn_storage; } - } - else - { + } + else + { { return NULL; } - } - case 'n': - if (strncmp (KR_keyword, "/dev/hdn", 8) == 0) + } + case 'm': + switch (KR_keyword [5]) + { + case 's': + if (strncmp (KR_keyword, "/dev/sdm", 8) == 0) { { -return &dev_hdn_storage; +return &dev_sdm_storage; } } @@ -988,10 +607,10 @@ return NULL; } } case 'm': - if (strncmp (KR_keyword, "/dev/hdm", 8) == 0) + if (strncmp (KR_keyword, "/dev/mem", 8) == 0) { { -return &dev_hdm_storage; +return &dev_mem_storage; } } @@ -1002,11 +621,11 @@ return NULL; } } - case 'l': - if (strncmp (KR_keyword, "/dev/hdl", 8) == 0) + case 'c': + if (strncmp (KR_keyword, "/dev/com", 8) == 0) { { -return &dev_hdl_storage; +return &dev_serial_storage; } } @@ -1017,131 +636,140 @@ return NULL; } } - case 'k': - if (strncmp (KR_keyword, "/dev/hdk", 8) == 0) - { + default: { -return &dev_hdk_storage; +return NULL; } - } - else - { + } + case 'l': + if (strncmp (KR_keyword, "/dev/sdl", 8) == 0) + { +{ +return &dev_sdl_storage; + +} + } + else + { { return NULL; } - } - case 'j': - if (strncmp (KR_keyword, "/dev/hdj", 8) == 0) - { + } + case 'k': + if (strncmp (KR_keyword, "/dev/sdk", 8) == 0) + { { -return &dev_hdj_storage; +return &dev_sdk_storage; } - } - else - { + } + else + { { return NULL; } - } - case 'i': - if (strncmp (KR_keyword, "/dev/hdi", 8) == 0) - { + } + case 'j': + if (strncmp (KR_keyword, "/dev/sdj", 8) == 0) + { { -return &dev_hdi_storage; +return &dev_sdj_storage; } - } - else - { + } + else + { { return NULL; } - } - case 'h': - if (strncmp (KR_keyword, "/dev/hdh", 8) == 0) - { + } + case 'i': + if (strncmp (KR_keyword, "/dev/sdi", 8) == 0) + { { -return &dev_hdh_storage; +return &dev_sdi_storage; } - } - else - { + } + else + { { return NULL; } - } - case 'g': - if (strncmp (KR_keyword, "/dev/hdg", 8) == 0) - { + } + case 'h': + if (strncmp (KR_keyword, "/dev/sdh", 8) == 0) + { { -return &dev_hdg_storage; +return &dev_sdh_storage; } - } - else - { + } + else + { { return NULL; } - } - case 'f': - if (strncmp (KR_keyword, "/dev/hdf", 8) == 0) - { + } + case 'g': + if (strncmp (KR_keyword, "/dev/sdg", 8) == 0) + { { -return &dev_hdf_storage; +return &dev_sdg_storage; } - } - else - { + } + else + { { return NULL; } - } - case 'e': - if (strncmp (KR_keyword, "/dev/hde", 8) == 0) - { + } + case 'f': + if (strncmp (KR_keyword, "/dev/sdf", 8) == 0) + { { -return &dev_hde_storage; +return &dev_sdf_storage; } - } - else - { + } + else + { { return NULL; } - } - case 'd': - if (strncmp (KR_keyword, "/dev/hdd", 8) == 0) - { + } + case 'e': + if (strncmp (KR_keyword, "/dev/sde", 8) == 0) + { { -return &dev_hdd_storage; +return &dev_sde_storage; } - } - else - { + } + else + { { return NULL; } - } - case 'c': - if (strncmp (KR_keyword, "/dev/hdc", 8) == 0) + } + case 'd': + switch (KR_keyword [6]) + { + case 'd': + if (strncmp (KR_keyword, "/dev/sdd", 8) == 0) { { -return &dev_hdc_storage; +return &dev_sdd_storage; } } @@ -1152,11 +780,11 @@ return NULL; } } - case 'b': - if (strncmp (KR_keyword, "/dev/hdb", 8) == 0) + case 'c': + if (strncmp (KR_keyword, "/dev/scd", 8) == 0) { { -return &dev_hdb_storage; +return &dev_cdrom_storage; } } @@ -1167,32 +795,32 @@ return NULL; } } - case 'a': - if (strncmp (KR_keyword, "/dev/hda", 8) == 0) - { + default: { -return &dev_hda_storage; +return NULL; } - } - else - { + } + case 'c': + if (strncmp (KR_keyword, "/dev/sdc", 8) == 0) + { { -return NULL; +return &dev_sdc_storage; } - } - default: + } + else + { { return NULL; } } - case 'd': - if (strncmp (KR_keyword, "/dev/dsp", 8) == 0) + case 'b': + if (strncmp (KR_keyword, "/dev/sdb", 8) == 0) { { -return &dev_oss_dsp_storage; +return &dev_sdb_storage; } } @@ -1203,11 +831,11 @@ return NULL; } } - case 'c': - if (strncmp (KR_keyword, "/dev/com", 8) == 0) + case 'a': + if (strncmp (KR_keyword, "/dev/sda", 8) == 0) { { -return &dev_serial_storage; +return &dev_sda_storage; } } @@ -1576,6 +1204,8 @@ device::parse (const char *s) dev = ttys_dev; // SIGH if (n >= dev->lower && n <= dev->upper) unit = n; + else + dev = NULL; } } } diff --git a/winsup/cygwin/devices.h b/winsup/cygwin/devices.h index 7e91b52b8..7e7cc92df 100644 --- a/winsup/cygwin/devices.h +++ b/winsup/cygwin/devices.h @@ -60,8 +60,8 @@ enum fh_devices FH_NTAPE = FHDEV (DEV_TAPE_MAJOR, 128), FH_MAXNTAPE= FHDEV (DEV_TAPE_MAJOR, 255), - DEV_SD_MAJOR = 3, - DEV_SD1_MAJOR = 90, + DEV_SD_MAJOR = 8, + DEV_SD1_MAJOR = 65, FH_SD = FHDEV (DEV_SD_MAJOR, 0), FH_SD1 = FHDEV (DEV_SD1_MAJOR, 0), FH_SDA = FHDEV (DEV_SD_MAJOR, 0), @@ -100,17 +100,17 @@ enum fh_devices FH_URANDOM = FHDEV (1, 9), FH_OSS_DSP = FHDEV (14, 3), - DEV_CYGDRIVE_MAJOR = 30, + DEV_CYGDRIVE_MAJOR = 29, FH_CYGDRIVE= FHDEV (DEV_CYGDRIVE_MAJOR, 0), FH_CYGDRIVE_A= FHDEV (DEV_CYGDRIVE_MAJOR, 'a'), FH_CYGDRIVE_Z= FHDEV (DEV_CYGDRIVE_MAJOR, 'z'), - DEV_RAWDRIVE_MAJOR = 65, + DEV_RAWDRIVE_MAJOR = 66, FH_RAWDRIVE= FHDEV (DEV_RAWDRIVE_MAJOR, 0), DEV_TCP_MAJOR = 30, FH_TCP = FHDEV (DEV_TCP_MAJOR, 36), - FH_UCP = FHDEV (DEV_TCP_MAJOR, 39), + FH_UDP = FHDEV (DEV_TCP_MAJOR, 39), FH_ICMP = FHDEV (DEV_TCP_MAJOR, 33), FH_UNIX = FHDEV (DEV_TCP_MAJOR, 120), FH_STREAM = FHDEV (DEV_TCP_MAJOR, 121), diff --git a/winsup/cygwin/devices.shilka b/winsup/cygwin/devices.shilka index 544c9238e..f029c71e3 100644 --- a/winsup/cygwin/devices.shilka +++ b/winsup/cygwin/devices.shilka @@ -31,7 +31,7 @@ const device dev_tcp_storage = {"/dev/inet/tcp", FH_TCP, "", 0, 0, 0, 0}; const device dev_udp_storage = - {"/dev/inet/udp", FH_UCP, "", 0, 0, 0, 0}; + {"/dev/inet/udp", FH_UDP, "", 0, 0, 0, 0}; const device dev_icmp_storage = {"/dev/inet/icmp", FH_ICMP, "", 0, 0, 0, 0}; @@ -129,83 +129,83 @@ const device dev_cdrom_storage = const device dev_sr_storage = {"/dev/sr", FH_CDROM, "\\Device\\CdRom%d", 0, 15}; -const device dev_hda_storage = -{"/dev/hda", FH_SDA, "\\Device\\Harddisk%d\\Partition%d", 1, 16, -1}; +const device dev_sda_storage = +{"/dev/sda", FH_SDA, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 0}; -const device dev_hdb_storage = -{"/dev/hdb", FH_SDB, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 15}; +const device dev_sdb_storage = +{"/dev/sdb", FH_SDB, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 16}; -const device dev_hdc_storage = -{"/dev/hdc", FH_SDC, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 31}; +const device dev_sdc_storage = +{"/dev/sdc", FH_SDC, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 32}; -const device dev_hdd_storage = -{"/dev/hdd", FH_SDD, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 47}; +const device dev_sdd_storage = +{"/dev/sdd", FH_SDD, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 48}; -const device dev_hde_storage = -{"/dev/hde", FH_SDE, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 63}; +const device dev_sde_storage = +{"/dev/sde", FH_SDE, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 64}; -const device dev_hdf_storage = -{"/dev/hdf", FH_SDF, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 79}; +const device dev_sdf_storage = +{"/dev/sdf", FH_SDF, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 80}; -const device dev_hdg_storage = -{"/dev/hdg", FH_SDG, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 95}; +const device dev_sdg_storage = +{"/dev/sdg", FH_SDG, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 96}; -const device dev_hdh_storage = -{"/dev/hdh", FH_SDH, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 111}; +const device dev_sdh_storage = +{"/dev/sdh", FH_SDH, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 112}; -const device dev_hdi_storage = -{"/dev/hdi", FH_SDI, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 127}; +const device dev_sdi_storage = +{"/dev/sdi", FH_SDI, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 128}; -const device dev_hdj_storage = -{"/dev/hdj", FH_SDJ, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 143}; +const device dev_sdj_storage = +{"/dev/sdj", FH_SDJ, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 144}; -const device dev_hdk_storage = -{"/dev/hdk", FH_SDK, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 159}; +const device dev_sdk_storage = +{"/dev/sdk", FH_SDK, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 160}; -const device dev_hdl_storage = -{"/dev/hdl", FH_SDL, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 175}; +const device dev_sdl_storage = +{"/dev/sdl", FH_SDL, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 176}; -const device dev_hdm_storage = -{"/dev/hdm", FH_SDM, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 191}; +const device dev_sdm_storage = +{"/dev/sdm", FH_SDM, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 192}; -const device dev_hdn_storage = -{"/dev/hdn", FH_SDN, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 207}; +const device dev_sdn_storage = +{"/dev/sdn", FH_SDN, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 208}; -const device dev_hdo_storage = -{"/dev/hdo", FH_SDO, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 223}; +const device dev_sdo_storage = +{"/dev/sdo", FH_SDO, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 224}; -const device dev_hdp_storage = -{"/dev/hdp", FH_SDP, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 239}; +const device dev_sdp_storage = +{"/dev/sdp", FH_SDP, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 240}; -const device dev_hdq_storage = -{"/dev/hdq", FH_SDQ, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 255 /* FIXME 8 bit lunacy */}; +const device dev_sdq_storage = +{"/dev/sdq", FH_SDQ, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 256}; -const device dev_hdr_storage = -{"/dev/hdr", FH_SDR, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 271}; +const device dev_sdr_storage = +{"/dev/sdr", FH_SDR, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 272}; -const device dev_hds_storage = -{"/dev/hds", FH_SDS, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 287}; +const device dev_sds_storage = +{"/dev/sds", FH_SDS, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 288}; -const device dev_hdt_storage = -{"/dev/hdt", FH_SDT, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 303}; +const device dev_sdt_storage = +{"/dev/sdt", FH_SDT, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 304}; -const device dev_hdu_storage = -{"/dev/hdu", FH_SDU, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 319}; +const device dev_sdu_storage = +{"/dev/sdu", FH_SDU, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 320}; -const device dev_hdv_storage = -{"/dev/hdv", FH_SDV, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 335}; +const device dev_sdv_storage = +{"/dev/sdv", FH_SDV, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 336}; -const device dev_hdw_storage = -{"/dev/hdw", FH_SDW, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 351}; +const device dev_sdw_storage = +{"/dev/sdw", FH_SDW, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 352}; -const device dev_hdx_storage = -{"/dev/hdx", FH_SDX, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 367}; +const device dev_sdx_storage = +{"/dev/sdx", FH_SDX, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 368}; -const device dev_hdy_storage = -{"/dev/hdy", FH_SDY, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 383}; +const device dev_sdy_storage = +{"/dev/sdy", FH_SDY, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 384}; -const device dev_hdz_storage = -{"/dev/hdz", FH_SDZ, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 399}; +const device dev_sdz_storage = +{"/dev/sdz", FH_SDZ, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 400}; const device dev_rawdrive_storage = {"/dev/rawdrive", FH_RAWDRIVE, "\\DosDevices\\%c:", 0, 0, 0, 0}; @@ -282,58 +282,32 @@ const device *uniq_devices[] = "/dev/fd" = fd {return &dev_floppy_storage;} "/dev/scd" = scd {return &dev_cdrom_storage;} "/dev/sr" = sr {return &dev_sr_storage;} -"/dev/hda" = hda {return &dev_hda_storage;} -"/dev/hdb" = hdb {return &dev_hdb_storage;} -"/dev/hdc" = hdc {return &dev_hdc_storage;} -"/dev/hdd" = hdd {return &dev_hdd_storage;} -"/dev/hde" = hde {return &dev_hde_storage;} -"/dev/hdf" = hdf {return &dev_hdf_storage;} -"/dev/hdg" = hdg {return &dev_hdg_storage;} -"/dev/hdh" = hdh {return &dev_hdh_storage;} -"/dev/hdi" = hdi {return &dev_hdi_storage;} -"/dev/hdj" = hdj {return &dev_hdj_storage;} -"/dev/hdk" = hdk {return &dev_hdk_storage;} -"/dev/hdl" = hdl {return &dev_hdl_storage;} -"/dev/hdm" = hdm {return &dev_hdm_storage;} -"/dev/hdn" = hdn {return &dev_hdn_storage;} -"/dev/hdo" = hdo {return &dev_hdo_storage;} -"/dev/hdp" = hdp {return &dev_hdp_storage;} -"/dev/hdq" = hdq {return &dev_hdq_storage;} -"/dev/hdr" = hdr {return &dev_hdr_storage;} -"/dev/hds" = hds {return &dev_hds_storage;} -"/dev/hdt" = hdt {return &dev_hdt_storage;} -"/dev/hdu" = hdu {return &dev_hdu_storage;} -"/dev/hdv" = hdv {return &dev_hdv_storage;} -"/dev/hdw" = hdw {return &dev_hdw_storage;} -"/dev/hdx" = hdx {return &dev_hdx_storage;} -"/dev/hdy" = hdy {return &dev_hdy_storage;} -"/dev/hdz" = hdz {return &dev_hdz_storage;} -"/dev/sda" = hda {return &dev_hda_storage;} -"/dev/sdb" = hdb {return &dev_hdb_storage;} -"/dev/sdc" = hdc {return &dev_hdc_storage;} -"/dev/sdd" = hdd {return &dev_hdd_storage;} -"/dev/sde" = hde {return &dev_hde_storage;} -"/dev/sdf" = hdf {return &dev_hdf_storage;} -"/dev/sdg" = hdg {return &dev_hdg_storage;} -"/dev/sdh" = hdh {return &dev_hdh_storage;} -"/dev/sdi" = hdi {return &dev_hdi_storage;} -"/dev/sdj" = hdj {return &dev_hdj_storage;} -"/dev/sdk" = hdk {return &dev_hdk_storage;} -"/dev/sdl" = hdl {return &dev_hdl_storage;} -"/dev/sdm" = hdm {return &dev_hdm_storage;} -"/dev/sdn" = hdn {return &dev_hdn_storage;} -"/dev/sdo" = hdo {return &dev_hdo_storage;} -"/dev/sdp" = hdp {return &dev_hdp_storage;} -"/dev/sdq" = hdq {return &dev_hdq_storage;} -"/dev/sdr" = hdr {return &dev_hdr_storage;} -"/dev/sds" = hds {return &dev_hds_storage;} -"/dev/sdt" = hdt {return &dev_hdt_storage;} -"/dev/sdu" = hdu {return &dev_hdu_storage;} -"/dev/sdv" = hdv {return &dev_hdv_storage;} -"/dev/sdw" = hdw {return &dev_hdw_storage;} -"/dev/sdx" = hdx {return &dev_hdx_storage;} -"/dev/sdy" = hdy {return &dev_hdy_storage;} -"/dev/sdz" = hdz {return &dev_hdz_storage;} +"/dev/sda" = sda {return &dev_sda_storage;} +"/dev/sdb" = sdb {return &dev_sdb_storage;} +"/dev/sdc" = sdc {return &dev_sdc_storage;} +"/dev/sdd" = sdd {return &dev_sdd_storage;} +"/dev/sde" = sde {return &dev_sde_storage;} +"/dev/sdf" = sdf {return &dev_sdf_storage;} +"/dev/sdg" = sdg {return &dev_sdg_storage;} +"/dev/sdh" = sdh {return &dev_sdh_storage;} +"/dev/sdi" = sdi {return &dev_sdi_storage;} +"/dev/sdj" = sdj {return &dev_sdj_storage;} +"/dev/sdk" = sdk {return &dev_sdk_storage;} +"/dev/sdl" = sdl {return &dev_sdl_storage;} +"/dev/sdm" = sdm {return &dev_sdm_storage;} +"/dev/sdn" = sdn {return &dev_sdn_storage;} +"/dev/sdo" = sdo {return &dev_sdo_storage;} +"/dev/sdp" = sdp {return &dev_sdp_storage;} +"/dev/sdq" = sdq {return &dev_sdq_storage;} +"/dev/sdr" = sdr {return &dev_sdr_storage;} +"/dev/sds" = sds {return &dev_sds_storage;} +"/dev/sdt" = sdt {return &dev_sdt_storage;} +"/dev/sdu" = sdu {return &dev_sdu_storage;} +"/dev/sdv" = sdv {return &dev_sdv_storage;} +"/dev/sdw" = sdw {return &dev_sdw_storage;} +"/dev/sdx" = sdx {return &dev_sdx_storage;} +"/dev/sdy" = sdy {return &dev_sdy_storage;} +"/dev/sdz" = sdz {return &dev_sdz_storage;} "/dev/rawdrive" = rawdrive {return &dev_rawdrive_storage;} %other {return NULL;} %% @@ -361,6 +335,8 @@ device::parse (const char *s) dev = ttys_dev; // SIGH if (n >= dev->lower && n <= dev->upper) unit = n; + else + dev = NULL; } } } diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index e7b185104..48b3d3001 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -382,7 +382,7 @@ build_fh_pc (path_conv& pc) fh = cnew (fhandler_pipe) (); break; case FH_TCP: - case FH_UCP: + case FH_UDP: case FH_ICMP: case FH_UNIX: case FH_STREAM: diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 241660885..92fb00d9f 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -903,17 +903,19 @@ win32_device_name (const char *src_path, char *win32_path, device& dev) if (dev.devn == FH_FS) return false; - switch (dev.devn) + switch (dev.major) { - case FH_TAPE: + case DEV_TAPE_MAJOR: __small_sprintf (win32_path, dev.fmt, dev.minor % 128); break; - case FH_RAWDRIVE: - __small_sprintf (win32_path, dev.fmt, dev.minor - 224 + 'A'); + case DEV_RAWDRIVE_MAJOR: + __small_sprintf (win32_path, dev.fmt, dev.minor + 'A'); + break; + case DEV_SD_MAJOR: + __small_sprintf (win32_path, dev.fmt, dev.minor / 16, dev.minor % 16); break; default: __small_sprintf (win32_path, dev.fmt, dev.minor); - break; } return true; } -- 2.43.5