From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Brush Date: Fri, 05 Mar 2004 09:08:52 +0000 Subject: [PATCH] make cmdline options permanent Message-Id: <200403050108.52966.ken@cgi101.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="Boundary-00=_kOESAowvXVZ9Yr8" List-Id: To: linux-hotplug@vger.kernel.org --Boundary-00=_kOESAowvXVZ9Yr8 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline I noticed this behavior in scsi_id and it was listed in the TODO as: - Document that config file options override command line options, or fix the code. This means a '-b' in the config file disables any -g on the command line. I chose to fix the code. Though, it appears to be a non-elegant solution to me, it seemed the least intrusive into the existing code. -Ken --Boundary-00=_kOESAowvXVZ9Yr8 Content-Type: text/x-diff; charset="us-ascii"; name="scsi_id.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="scsi_id.patch" --- udev-021.orig/extras/scsi_id/scsi_id.c 2004-03-02 16:01:31.000000000 -0800 +++ udev-021/extras/scsi_id/scsi_id.c 2004-03-05 00:58:46.438876291 -0800 @@ -58,6 +58,10 @@ */ static const char dev_short_options[] = "bgp:"; +/* cmdline options */ +static char cmdline_options[sizeof(short_options)]; +static int cmdline; + char sysfs_mnt_path[SYSFS_PATH_MAX]; static int all_good; @@ -421,9 +425,17 @@ else dprintf("option '%c'\n", option); + /* Store the option */ + if(cmdline == 0) + cmdline_options[strlen(cmdline_options)] = option; + switch (option) { case 'b': + if((cmdline == 0) || + (cmdline == 1 && + strchr(cmdline_options,'b') != NULL)) all_good = 0; + break; case 'c': @@ -444,6 +456,9 @@ break; case 'g': + if((cmdline == 0) || + (cmdline == 1 && + strchr(cmdline_options,'g') != NULL)) all_good = 1; break; @@ -486,6 +501,8 @@ return -1; } } + /* set cmdline to prevent squashing of the cmdline options */ + cmdline = 1; return 0; } --Boundary-00=_kOESAowvXVZ9Yr8-- ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel