aboutsummaryrefslogtreecommitdiff
path: root/miscutils/hdparm.c
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-05-31 22:52:57 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-05-31 22:52:57 +0000
commit668e90f49dbaa653e05445f77c6f9313573423bb (patch)
tree8cf532e46f72f88e3d978729b85da33c05708ae0 /miscutils/hdparm.c
parentbad6879a8f3bfc48e7b874a6de6d0b4a08645642 (diff)
downloadbusybox-w32-668e90f49dbaa653e05445f77c6f9313573423bb.tar.gz
busybox-w32-668e90f49dbaa653e05445f77c6f9313573423bb.tar.bz2
busybox-w32-668e90f49dbaa653e05445f77c6f9313573423bb.zip
Patch from Tito to remove long options from hdparm.
git-svn-id: svn://busybox.net/trunk/busybox@15254 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'miscutils/hdparm.c')
-rw-r--r--miscutils/hdparm.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c
index 55ed2f6ff..37b87ea9f 100644
--- a/miscutils/hdparm.c
+++ b/miscutils/hdparm.c
@@ -23,7 +23,6 @@
23#include <sys/times.h> 23#include <sys/times.h>
24#include <sys/mount.h> 24#include <sys/mount.h>
25#include <sys/mman.h> 25#include <sys/mman.h>
26#include <getopt.h>
27#include <linux/types.h> 26#include <linux/types.h>
28#include <linux/hdreg.h> 27#include <linux/hdreg.h>
29 28
@@ -2095,21 +2094,9 @@ static void parse_xfermode(int flag, unsigned long *get, unsigned long *set, int
2095 } 2094 }
2096} 2095}
2097 2096
2098/*-------------------------------------*/ 2097/*------- getopt short options --------*/
2099/* getopt long options */
2100#if ENABLE_FEATURE_HDPARM_GET_IDENTITY
2101static const struct option HDPARM_LONG_OPT[] =
2102{
2103 {"Istdin", 0, NULL, '\256'},
2104 {NULL, 0, NULL, 0}
2105};
2106#else
2107#define HDPARM_LONG_OPT NULL
2108#endif
2109/*-------------------------------------*/
2110/* getopt short options */
2111static const char hdparm_options[]= "gfu::n::p:r::m::c::k::a::B:tTh"\ 2098static const char hdparm_options[]= "gfu::n::p:r::m::c::k::a::B:tTh"\
2112 USE_FEATURE_HDPARM_GET_IDENTITY("\256iI") 2099 USE_FEATURE_HDPARM_GET_IDENTITY("iI")
2113 USE_FEATURE_HDPARM_HDIO_GETSET_DMA("d::") 2100 USE_FEATURE_HDPARM_HDIO_GETSET_DMA("d::")
2114#ifdef HDIO_DRIVE_CMD 2101#ifdef HDIO_DRIVE_CMD
2115 "S::D::P::X::K::A::L::W::CyYzZ" 2102 "S::D::P::X::K::A::L::W::CyYzZ"
@@ -2134,13 +2121,9 @@ int hdparm_main(int argc, char **argv)
2134 int c; 2121 int c;
2135 int flagcount = 0; 2122 int flagcount = 0;
2136 2123
2137 while ((c = getopt_long (argc, argv, hdparm_options, HDPARM_LONG_OPT , NULL)) >= 0) { 2124 while ((c = getopt(argc, argv, hdparm_options)) >= 0) {
2138 flagcount++; 2125 flagcount++;
2139#if ENABLE_FEATURE_HDPARM_GET_IDENTITY 2126 if (c == 'h') bb_show_usage(); /* EXIT */
2140 if (c == '\256') {
2141 identify_from_stdin(); /* EXIT */
2142 }
2143#endif
2144 USE_FEATURE_HDPARM_GET_IDENTITY(get_IDentity = (c == 'I')); 2127 USE_FEATURE_HDPARM_GET_IDENTITY(get_IDentity = (c == 'I'));
2145 USE_FEATURE_HDPARM_GET_IDENTITY(get_identity = (c == 'i')); 2128 USE_FEATURE_HDPARM_GET_IDENTITY(get_identity = (c == 'i'));
2146 get_geom |= (c == 'g'); 2129 get_geom |= (c == 'g');
@@ -2204,9 +2187,11 @@ int hdparm_main(int argc, char **argv)
2204 argc -= optind; 2187 argc -= optind;
2205 argv += optind; 2188 argv += optind;
2206 2189
2190#if ENABLE_FEATURE_HDPARM_GET_IDENTITY
2207 if (argc < 1) { 2191 if (argc < 1) {
2208 bb_show_usage(); 2192 identify_from_stdin(); /* EXIT */
2209 } 2193 }
2194#endif
2210 2195
2211 while (argc--) { 2196 while (argc--) {
2212 process_dev(*argv); 2197 process_dev(*argv);