public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: kerolasa@iki.fi
Subject: [PATCH] fallocate: avoid preprocessor token redefinitions
Date: Tue,  7 Jan 2014 22:04:59 +0000	[thread overview]
Message-ID: <1389132299-12109-1-git-send-email-kerolasa@iki.fi> (raw)

The FALLOC_FL_KEEP_SIZE and FALLOC_FL_PUNCH_HOLE are part of
bits/fcntl-linux.h, and one should prefer use of libc rather than
kernel header linux/falloc.h when possible.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 sys-utils/fallocate.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys-utils/fallocate.c b/sys-utils/fallocate.c
index 6a87673..9fa1e58 100644
--- a/sys-utils/fallocate.c
+++ b/sys-utils/fallocate.c
@@ -36,8 +36,10 @@
 # include <sys/syscall.h>
 #endif
 
-#ifdef HAVE_LINUX_FALLOC_H
-# include <linux/falloc.h>	/* for FALLOC_FL_* flags */
+#ifndef HAVE_LINUX_FALLOC_H
+# ifndef FALLOC_FL_KEEP_SIZE	/* FALLOC_FL_* should be part of */
+#  include <linux/falloc.h>	/* bits/fcntl-linux.h that is */
+# endif				/* included by fcntl.h */
 #endif
 
 #ifndef FALLOC_FL_KEEP_SIZE
-- 
1.8.5.2


             reply	other threads:[~2014-01-07 22:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 22:04 Sami Kerola [this message]
2014-01-13 13:56 ` [PATCH] fallocate: avoid preprocessor token redefinitions Karel Zak

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=1389132299-12109-1-git-send-email-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=util-linux@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