diff options
author | ed <ed@FreeBSD.org> | 2012-01-02 12:12:10 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-01-02 12:12:10 +0000 |
commit | ab210c8f2f4f0cd4839d93f66181fc7ad57ce8a9 (patch) | |
tree | c3375fb3aa9ccc6f33c26a511457552dfbab74a7 /sys/i386/ibcs2 | |
parent | d9de01105e6c2f60ef0fb2a67c0f3d915cef8c61 (diff) | |
download | FreeBSD-src-ab210c8f2f4f0cd4839d93f66181fc7ad57ce8a9.zip FreeBSD-src-ab210c8f2f4f0cd4839d93f66181fc7ad57ce8a9.tar.gz |
Use strchr() and strrchr().
It seems strchr() and strrchr() are used more often than index() and
rindex(). Therefore, simply migrate all kernel code to use it.
For the XFS code, remove an empty line to make the code identical to
the code in the Linux kernel.
Diffstat (limited to 'sys/i386/ibcs2')
-rw-r--r-- | sys/i386/ibcs2/ibcs2_socksys.c | 4 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_stat.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/i386/ibcs2/ibcs2_socksys.c b/sys/i386/ibcs2/ibcs2_socksys.c index ce96fc9..80b1216 100644 --- a/sys/i386/ibcs2/ibcs2_socksys.c +++ b/sys/i386/ibcs2/ibcs2_socksys.c @@ -152,7 +152,7 @@ ibcs2_getipdomainname(td, uap) /* Get the domain name. */ getcredhostname(td->td_ucred, hname, sizeof(hname)); - dptr = index(hname, '.'); + dptr = strchr(hname, '.'); if ( dptr ) dptr++; else @@ -182,7 +182,7 @@ ibcs2_setipdomainname(td, uap) return EINVAL; /* Get the host's unqualified name (strip off the domain) */ - ptr = index(hname, '.'); + ptr = strchr(hname, '.'); if ( ptr != NULL ) { ptr++; *ptr = '\0'; diff --git a/sys/i386/ibcs2/ibcs2_stat.c b/sys/i386/ibcs2/ibcs2_stat.c index b61e45e..c1097a3 100644 --- a/sys/i386/ibcs2/ibcs2_stat.c +++ b/sys/i386/ibcs2/ibcs2_stat.c @@ -212,7 +212,7 @@ ibcs2_utssys(td, uap) IBCS2_UNAME_VERSION, sizeof(sut.version) - 1); getcredhostname(td->td_ucred, machine_name, sizeof(machine_name) - 1); - p = index(machine_name, '.'); + p = strchr(machine_name, '.'); if ( p ) *p = '\0'; strncpy(sut.nodename, machine_name, sizeof(sut.nodename) - 1); |