lkml.org 
[lkml]   [2016]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH net-next 2/2] errqueue: include linux/time.h
    Date
    From: Willem de Bruijn <willemb@google.com>

    struct scm_timestamping has fields of type struct timespec. Now that
    it is safe to include linux/time.h and time.h at the same time,
    include linux/time.h directly in linux/errqueue.h

    Without this patch, when compiling the following program after
    make headers_install:

    gcc -Wall -Werror -Iusr/include -c -xc - <<EOF
    #include <linux/errqueue.h>
    static struct scm_timestamping tss;
    int main(void) { tss.ts[0].tv_sec = 1; return 0; }
    EOF

    gcc gives this error:

    In file included from <stdin>:1:0:
    usr/include/linux/errqueue.h:33:18: error: array type has incomplete element type
    struct timespec ts[3];

    Reported-by: Brooks Moses <bmoses@google.com>
    Signed-off-by: Willem de Bruijn <willemb@google.com>
    ---
    include/uapi/linux/errqueue.h | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/include/uapi/linux/errqueue.h b/include/uapi/linux/errqueue.h
    index 07bdce1..abafec8 100644
    --- a/include/uapi/linux/errqueue.h
    +++ b/include/uapi/linux/errqueue.h
    @@ -1,6 +1,7 @@
    #ifndef _UAPI_LINUX_ERRQUEUE_H
    #define _UAPI_LINUX_ERRQUEUE_H

    +#include <linux/time.h>
    #include <linux/types.h>

    struct sock_extended_err {
    --
    2.8.0.rc3.226.g39d4020
    \
     
     \ /
      Last update: 2016-09-17 09:59    [W:4.494 / U:1.372 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site