On Mon, Apr 20, 2009 at 07:27:36PM +0530, Dhaval Giani wrote:
> +
> +int cgroup_get_task_next(void **handle, pid_t *pid)
> +{
> + FILE *tasks;
> + int ret;
> +
> + if (!cgroup_initialized)
> + return ECGROUPNOTINITIALIZED;
> +
> + if (!handle)
> + return ECGINVAL;
> +
> + tasks = (FILE *) *handle;
> +
> + if (feof(tasks))
> + return ECGEOF;
> +
Is it necessary to use feof() here ? Isn't fscanf() capable of handling
eof condition ?
> + ret = fscanf(tasks, "%u", pid);
> +
> + if (ret != 1) {
> + *handle = tasks;
> + if (feof(tasks))
> + return ECGEOF;
Also here.
Regards,
Bharata.
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel