lkml.org 
[lkml]   [2005]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[-mm patch] inotify: fsnotify.h: use kstrdup
    kstrdup was added in 2.6.13-rc1.

    Signed-off-by: Adrian Bunk <bunk@stusta.de>

    --- linux-2.6.12-mm2-full/include/linux/fsnotify.h.old 2005-06-30 22:26:07.000000000 +0200
    +++ linux-2.6.12-mm2-full/include/linux/fsnotify.h 2005-06-30 22:27:26.000000000 +0200
    @@ -216,19 +216,10 @@

    /*
    * fsnotify_oldname_init - save off the old filename before we change it
    - *
    - * XXX: This could be kstrdup if only we could add that to lib/string.c
    */
    static inline const char *fsnotify_oldname_init(const char *name)
    {
    - size_t len;
    - char *buf;
    -
    - len = strlen(name) + 1;
    - buf = kmalloc(len, GFP_KERNEL);
    - if (likely(buf))
    - memcpy(buf, name, len);
    - return buf;
    + return kstrdup(name, GFP_KERNEL);
    }

    /*
    -
    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: 2005-07-02 01:01    [W:0.036 / U:1.508 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site