util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] build-sys: add missing headers to dist
@ 2011-12-01 22:10 Sami Kerola
  2011-12-01 22:10 ` [PATCH 2/2] build-sys: check HAVE_ definitions with #ifdef [smatch scan] Sami Kerola
  2011-12-02 17:22 ` [PATCH 1/2] build-sys: add missing headers to dist Karel Zak
  0 siblings, 2 replies; 4+ messages in thread
From: Sami Kerola @ 2011-12-01 22:10 UTC (permalink / raw)
  To: util-linux; +Cc: kerolasa

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 include/Makefile.am |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/Makefile.am b/include/Makefile.am
index 237840a..aa72a3e 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -18,10 +18,12 @@ dist_noinst_HEADERS = \
 	list.h \
 	loopdev.h \
 	mangle.h \
+	match.h \
 	mbsalign.h \
 	md5.h \
 	minix.h \
 	nls.h \
+	optutils.h \
 	pamfail.h \
 	path.h \
 	pathnames.h \
-- 
1.7.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] build-sys: check HAVE_ definitions with #ifdef [smatch scan]
  2011-12-01 22:10 [PATCH 1/2] build-sys: add missing headers to dist Sami Kerola
@ 2011-12-01 22:10 ` Sami Kerola
  2011-12-02 17:29   ` Karel Zak
  2011-12-02 17:22 ` [PATCH 1/2] build-sys: add missing headers to dist Karel Zak
  1 sibling, 1 reply; 4+ messages in thread
From: Sami Kerola @ 2011-12-01 22:10 UTC (permalink / raw)
  To: util-linux; +Cc: kerolasa

Fix to `warning: undefined preprocessor identifier' messages.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 include/blkdev.h       |    2 +-
 include/md5.h          |    2 +-
 lib/env.c              |    2 +-
 lib/ismounted.c        |    2 +-
 libblkid/src/cache.c   |    2 +-
 libblkid/src/devname.c |    8 ++++----
 libblkid/src/devno.c   |   10 +++++-----
 libblkid/src/llseek.c  |    6 +++---
 libblkid/src/read.c    |    4 ++--
 libblkid/src/resolve.c |    2 +-
 libblkid/src/version.c |    2 +-
 misc-utils/cal.c       |    2 +-
 term-utils/script.c    |   10 +++++++---
 13 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/include/blkdev.h b/include/blkdev.h
index 3ce8111..1e7409d 100644
--- a/include/blkdev.h
+++ b/include/blkdev.h
@@ -9,7 +9,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#if HAVE_SYS_MKDEV_H
+#ifdef HAVE_SYS_MKDEV_H
 # include <sys/mkdev.h>		/* major and minor on Solaris */
 #endif
 
diff --git a/include/md5.h b/include/md5.h
index 1222cf0..d997e37 100644
--- a/include/md5.h
+++ b/include/md5.h
@@ -1,7 +1,7 @@
 #ifndef MD5_H
 #define MD5_H
 
-#if HAVE_STDINT_H
+#ifdef HAVE_STDINT_H
 #include <stdint.h>
 #else
 typedef unsigned int uint32_t;
diff --git a/lib/env.c b/lib/env.c
index 770cadf..e6d119f 100644
--- a/lib/env.c
+++ b/lib/env.c
@@ -89,7 +89,7 @@ char *safe_getenv(const char *arg)
 
 	if (ruid != 0 || (ruid != geteuid()) || (getgid() != getegid()))
 		return NULL;
-#if HAVE_PRCTL
+#ifdef HAVE_PRCTL
 	if (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 0)
 		return NULL;
 #else
diff --git a/lib/ismounted.c b/lib/ismounted.c
index f19d67b..273a7d9 100644
--- a/lib/ismounted.c
+++ b/lib/ismounted.c
@@ -11,7 +11,7 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <fcntl.h>
-#if HAVE_MNTENT_H
+#ifdef HAVE_MNTENT_H
 #include <mntent.h>
 #endif
 #include <string.h>
diff --git a/libblkid/src/cache.c b/libblkid/src/cache.c
index 6ef22a1..c100cfa 100644
--- a/libblkid/src/cache.c
+++ b/libblkid/src/cache.c
@@ -10,7 +10,7 @@
  * %End-Header%
  */
 
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 #ifdef HAVE_ERRNO_H
diff --git a/libblkid/src/devname.c b/libblkid/src/devname.c
index 42a8c19..12cd93a 100644
--- a/libblkid/src/devname.c
+++ b/libblkid/src/devname.c
@@ -16,20 +16,20 @@
 #include <stdio.h>
 #include <string.h>
 #include <limits.h>
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 #include <stdlib.h>
 #include <ctype.h>
 #include <fcntl.h>
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
 #include <dirent.h>
-#if HAVE_SYS_STAT_H
+#ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
-#if HAVE_ERRNO_H
+#ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
 #include <time.h>
diff --git a/libblkid/src/devno.c b/libblkid/src/devno.c
index 92ed7c0..b2a8be5 100644
--- a/libblkid/src/devno.c
+++ b/libblkid/src/devno.c
@@ -12,21 +12,21 @@
 
 #include <stdio.h>
 #include <string.h>
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 #include <stdlib.h>
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
-#if HAVE_SYS_STAT_H
+#ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
 #include <dirent.h>
-#if HAVE_ERRNO_H
+#ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
-#if HAVE_SYS_MKDEV_H
+#ifdef HAVE_SYS_MKDEV_H
 #include <sys/mkdev.h>
 #endif
 #include <fcntl.h>
diff --git a/libblkid/src/llseek.c b/libblkid/src/llseek.c
index 5bd0e51..7fb44c4 100644
--- a/libblkid/src/llseek.c
+++ b/libblkid/src/llseek.c
@@ -12,14 +12,14 @@
 #define _LARGEFILE_SOURCE
 #define _LARGEFILE64_SOURCE
 
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
 
-#if HAVE_ERRNO_H
+#ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 #ifdef __MSDOS__
diff --git a/libblkid/src/read.c b/libblkid/src/read.c
index c404bb0..b9fda3a 100644
--- a/libblkid/src/read.c
+++ b/libblkid/src/read.c
@@ -19,13 +19,13 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
-#if HAVE_ERRNO_H
+#ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
 
 #include "blkidP.h"
 
-#if HAVE_STDLIB_H
+#ifdef HAVE_STDLIB_H
 # ifndef _XOPEN_SOURCE
 #  define _XOPEN_SOURCE 600	/* for inclusion of strtoull */
 # endif
diff --git a/libblkid/src/resolve.c b/libblkid/src/resolve.c
index bf13b86..bf5041d 100644
--- a/libblkid/src/resolve.c
+++ b/libblkid/src/resolve.c
@@ -11,7 +11,7 @@
  */
 
 #include <stdio.h>
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 #include <stdlib.h>
diff --git a/libblkid/src/version.c b/libblkid/src/version.c
index 4c7fa06..63f02f6 100644
--- a/libblkid/src/version.c
+++ b/libblkid/src/version.c
@@ -9,7 +9,7 @@
  * %End-Header%
  */
 
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 #include <string.h>
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index 1c810ca..c9efdf0 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -297,7 +297,7 @@ main(int argc, char **argv) {
  * the locale database, which can be overridden with the
  * -s (Sunday) or -m (Monday) options.
  */
-#if HAVE_DECL__NL_TIME_WEEK_1STDAY
+#ifdef HAVE_DECL__NL_TIME_WEEK_1STDAY
 	/*
 	 * You need to use 2 locale variables to get the first day of the week.
 	 * This is needed to support first_weekday=2 and first_workday=1 for
diff --git a/term-utils/script.c b/term-utils/script.c
index 3891bf9..9e08ff6 100644
--- a/term-utils/script.c
+++ b/term-utils/script.c
@@ -62,8 +62,10 @@
 #include "nls.h"
 #include "c.h"
 
-#if HAVE_LIBUTIL && HAVE_PTY_H
-#include <pty.h>
+#ifdef HAVE_LIBUTIL
+# ifdef HAVE_PTY_H
+#  include <pty.h>
+# endif
 #endif
 
 #ifdef HAVE_LIBUTEMPTER
@@ -499,13 +501,15 @@ done(void) {
 
 void
 getmaster(void) {
-#if HAVE_LIBUTIL && HAVE_PTY_H
+#ifdef HAVE_LIBUTIL
+# ifdef HAVE_PTY_H
 	tcgetattr(STDIN_FILENO, &tt);
 	ioctl(STDIN_FILENO, TIOCGWINSZ, (char *)&win);
 	if (openpty(&master, &slave, NULL, &tt, &win) < 0) {
 		warn(_("openpty failed"));
 		fail();
 	}
+# endif
 #else
 	char *pty, *bank, *cp;
 	struct stat stb;
-- 
1.7.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] build-sys: add missing headers to dist
  2011-12-01 22:10 [PATCH 1/2] build-sys: add missing headers to dist Sami Kerola
  2011-12-01 22:10 ` [PATCH 2/2] build-sys: check HAVE_ definitions with #ifdef [smatch scan] Sami Kerola
@ 2011-12-02 17:22 ` Karel Zak
  1 sibling, 0 replies; 4+ messages in thread
From: Karel Zak @ 2011-12-02 17:22 UTC (permalink / raw)
  To: Sami Kerola; +Cc: util-linux

On Thu, Dec 01, 2011 at 11:10:20PM +0100, Sami Kerola wrote:
>  include/Makefile.am |    2 ++

 Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] build-sys: check HAVE_ definitions with #ifdef [smatch scan]
  2011-12-01 22:10 ` [PATCH 2/2] build-sys: check HAVE_ definitions with #ifdef [smatch scan] Sami Kerola
@ 2011-12-02 17:29   ` Karel Zak
  0 siblings, 0 replies; 4+ messages in thread
From: Karel Zak @ 2011-12-02 17:29 UTC (permalink / raw)
  To: Sami Kerola; +Cc: util-linux

On Thu, Dec 01, 2011 at 11:10:21PM +0100, Sami Kerola wrote:
>  include/blkdev.h       |    2 +-
>  include/md5.h          |    2 +-
>  lib/env.c              |    2 +-
>  lib/ismounted.c        |    2 +-
>  libblkid/src/cache.c   |    2 +-
>  libblkid/src/devname.c |    8 ++++----
>  libblkid/src/devno.c   |   10 +++++-----
>  libblkid/src/llseek.c  |    6 +++---
>  libblkid/src/read.c    |    4 ++--
>  libblkid/src/resolve.c |    2 +-
>  libblkid/src/version.c |    2 +-
>  misc-utils/cal.c       |    2 +-
>  term-utils/script.c    |   10 +++++++---
>  13 files changed, 29 insertions(+), 25 deletions(-)

 Applied, thanks.

>> -#if HAVE_LIBUTIL && HAVE_PTY_H
> +#ifdef HAVE_LIBUTIL
> +# ifdef HAVE_PTY_H

here we can use:

    #if defined(HAVE_LIBUTIL) && defined(HAVE_PTY_H)


 Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-02 17:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-01 22:10 [PATCH 1/2] build-sys: add missing headers to dist Sami Kerola
2011-12-01 22:10 ` [PATCH 2/2] build-sys: check HAVE_ definitions with #ifdef [smatch scan] Sami Kerola
2011-12-02 17:29   ` Karel Zak
2011-12-02 17:22 ` [PATCH 1/2] build-sys: add missing headers to dist Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).