Linux NFS development
 help / color / mirror / Atom feed
From: Steve Dickson <steved@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] reexport.c: Some Distros need the following include to avoid the following error
Date: Tue, 23 Jan 2024 10:16:16 -0500	[thread overview]
Message-ID: <6206ba66-5bee-4a4f-9af6-cf10f93163d3@redhat.com> (raw)
In-Reply-To: <20240122182909.97503-1-steved@redhat.com>



On 1/22/24 1:29 PM, Steve Dickson wrote:
> reexport.c: In function ‘connect_fsid_service’:
> reexport.c:41:28: error: implicit declaration of function ‘offsetof’ [-Werror=implicit-function-declaration]
>     41 |                 addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(addr.sun_path);
>        |                            ^~~~~~~~
> reexport.c:19:1: note: ‘offsetof’ is defined in header ‘<stddef.h>’; did you forget to ‘#include <stddef.h>’?
>     18 | #include "xlog.h"
>    +++ |+#include <stddef.h>
>     19 |
> reexport.c:41:37: error: expected expression before ‘struct’
>     41 |                 addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(addr.sun_path);
>        |                                     ^~~~~~
> cc1: some warnings being treated as errors
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed... (tag: nfs-utils-2-7-1-rc4)

steved.
> ---
>   support/reexport/reexport.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/support/reexport/reexport.c b/support/reexport/reexport.c
> index c7bff6a..1febf59 100644
> --- a/support/reexport/reexport.c
> +++ b/support/reexport/reexport.c
> @@ -9,6 +9,7 @@
>   #include <sys/vfs.h>
>   #include <unistd.h>
>   #include <errno.h>
> +#include <stddef.h>
>   
>   #include "nfsd_path.h"
>   #include "conffile.h"


      reply	other threads:[~2024-01-23 15:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 18:29 [PATCH] reexport.c: Some Distros need the following include to avoid the following error Steve Dickson
2024-01-23 15:16 ` Steve Dickson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6206ba66-5bee-4a4f-9af6-cf10f93163d3@redhat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox