]> granicus.if.org Git - procps-ng/commitdiff
sysctl: remove index() for buildroot
authorSteven J. Hill <sjhill@realitydiluted.com>
Tue, 5 Dec 2006 02:16:03 +0000 (02:16 +0000)
committerCraig Small <csmall@enc.com.au>
Sat, 17 Dec 2011 23:28:21 +0000 (10:28 +1100)
The uClibc does not support index() function.

A patch from Buildroot.

Reference: http://git.buildroot.net/buildroot/patch/?id=f460603f02092b4f514d108dd8b4167a7a056213
Backported-by: Sami Kerola <kerolasa@iki.fi>
sysctl.c

index 57d3e9aa3fe7e0271c0a780ee876e570c807e7e9..b6e1071dcd54d2d54d9d256e9dc8e0647ed530a8 100644 (file)
--- a/sysctl.c
+++ b/sysctl.c
@@ -297,7 +297,7 @@ static int WriteSetting(const char *setting) {
       return 0;
    } /* end if */
 
-   equals = index(setting, '=');
+   equals = strchr(setting, '=');
  
    if (!equals) {
       fprintf(stderr, ERR_NO_EQUALS, setting);
@@ -546,7 +546,7 @@ int main(int argc, char *argv[]) {
          if (NameOnly && Quiet)   // nonsense
             return Usage(me);
          SwitchesAllowed = false;
-         if (WriteMode || index(*argv, '='))
+         if (WriteMode || strchr(*argv, '='))
             ReturnCode = WriteSetting(*argv);
          else
             ReturnCode = ReadSetting(*argv);