[Ocfs2-devel] [PATCH] provide strsep for ancient kernels

Manish Singh manish.singh at oracle.com
Tue Jun 22 16:48:00 CDT 2004


On Tue, Jun 22, 2004 at 02:22:54PM +0200, Christoph Hellwig wrote:
> Index: src/ocfs_compat.h
> ===================================================================
> --- src/ocfs_compat.h	(revision 1182)
> +++ src/ocfs_compat.h	(working copy)
> @@ -87,6 +87,19 @@
>  	sb->s_blocksize_bits = bits;
>  	return sb->s_blocksize;
>  }
> +
> +static inline char *strsep(char **s, const char *ct)
> +{
> +	char *sbegin = *s, *end;
> +
> +	if (sbegin == NULL)
> +		return NULL;
> +	end = strpbrk(sbegin, ct);
> +	if (end)
> +		*end++ = '\0';
> +	*s = end;
> +	return sbegin;
> +}
>  #endif

strsep actually is in AS 2.1's 2.4.9, so I didn't stick it in the compat
header. This was probably a holdover from years ago, when we were look
at a pretty ancient kernel tree.

-Manish


More information about the Ocfs2-devel mailing list