lkml.org 
[lkml]   [2007]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kernel/capability.c get_task_comm compile error (MMOTM)

* Erez Zadok <ezk@cs.sunysb.edu> wrote:

> Ingo, I don't see how it can return NULL. This is what get_task_comm
> looks like in MMOTM-2007-11-10-19-05:
>
> char *get_task_comm(char *buf, struct task_struct *tsk)
> {
> /* buf must be at least sizeof(tsk->comm) in size */
> task_lock(tsk);
> strncpy(buf, tsk->comm, sizeof(tsk->comm));
> task_unlock(tsk);
> return buf;
> }
>
> The only way it'd return NULL is if a null buf was passed, in which
> case the strncpy will oops first.

hm, here it says in include/linux/sched.h:

extern void get_task_comm(char *to, struct task_struct *tsk);

HEAD ecd744eec3a.

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-11-11 21:47    [W:0.056 / U:0.772 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site