summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_mqueue.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2012-01-02 12:12:10 +0000
committered <ed@FreeBSD.org>2012-01-02 12:12:10 +0000
commitab210c8f2f4f0cd4839d93f66181fc7ad57ce8a9 (patch)
treec3375fb3aa9ccc6f33c26a511457552dfbab74a7 /sys/kern/uipc_mqueue.c
parentd9de01105e6c2f60ef0fb2a67c0f3d915cef8c61 (diff)
downloadFreeBSD-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/kern/uipc_mqueue.c')
-rw-r--r--sys/kern/uipc_mqueue.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c
index 696f974..212daba 100644
--- a/sys/kern/uipc_mqueue.c
+++ b/sys/kern/uipc_mqueue.c
@@ -1974,7 +1974,7 @@ kern_kmq_open(struct thread *td, const char *upath, int flags, mode_t mode,
* characters.
*/
len = strlen(path);
- if (len < 2 || path[0] != '/' || index(path + 1, '/') != NULL)
+ if (len < 2 || path[0] != '/' || strchr(path + 1, '/') != NULL)
return (EINVAL);
error = falloc(td, &fp, &fd, 0);
@@ -2077,7 +2077,7 @@ sys_kmq_unlink(struct thread *td, struct kmq_unlink_args *uap)
return (error);
len = strlen(path);
- if (len < 2 || path[0] != '/' || index(path + 1, '/') != NULL)
+ if (len < 2 || path[0] != '/' || strchr(path + 1, '/') != NULL)
return (EINVAL);
sx_xlock(&mqfs_data.mi_lock);
OpenPOWER on IntegriCloud