lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Wed, 11 Jun 2014 13:00:24 -0600
From:	Andreas Dilger <adilger@...ger.ca>
To:	tytso@....edu
Cc:	Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH] blkid: remove unnecessary header and comment

I noticed there is more that could be cleaned up if we don't need
to check for the <sys/queue.h> header at all.  New patch follows.

Cheers, Andreas

On Jun 11, 2014, at 12:40 PM, Andreas Dilger <adilger@...ger.ca> wrote:

> The LIST_HEAD macro is not directly used in getsize.c, so
> <sys/queue.h> is not needed at all, and could cause confusion at
> some later point if the Linux-style list macros are ever used.
> 
> Build was verified on MacOS which defined HAVE_SYS_DISK_H true.
> I manually inspected the sources for recent *BSD headers to check
> if this was needed there or not.  MacOS and FreeBSD <sys/disk.h>
> do not use lists at all.  NetBSD and OpenBSD <sys/disk.h> include
> <sys/queue.h> internally.
> 
> Signed-off-by: Andreas Dilger <adilger@...ger.ca>
> ---
> lib/blkid/getsize.c  | 4 ----
> lib/ext2fs/getsize.c | 3 ---
> 2 files changed, 7 deletions(-)
> 
> diff --git a/lib/blkid/getsize.c b/lib/blkid/getsize.c
> index c2a8f72..a5c40aa 100644
> --- a/lib/blkid/getsize.c
> +++ b/lib/blkid/getsize.c
> @@ -12,7 +12,6 @@
> #define _LARGEFILE_SOURCE
> #define _LARGEFILE64_SOURCE
> 
> -/* include this before sys/queues.h! */
> #include "config.h"
> #include "blkidP.h"
> 
> @@ -34,9 +33,6 @@
> #include <sys/disklabel.h>
> #endif
> #ifdef HAVE_SYS_DISK_H
> -#ifdef HAVE_SYS_QUEUE_H
> -#include <sys/queue.h> /* for LIST_HEAD */
> -#endif
> #include <sys/disk.h>
> #endif
> #ifdef __linux__
> diff --git a/lib/ext2fs/getsize.c b/lib/ext2fs/getsize.c
> index a9a4812..a227155 100644
> --- a/lib/ext2fs/getsize.c
> +++ b/lib/ext2fs/getsize.c
> @@ -34,9 +34,6 @@
> #include <sys/disklabel.h>
> #endif
> #ifdef HAVE_SYS_DISK_H
> -#ifdef HAVE_SYS_QUEUE_H
> -#include <sys/queue.h> /* for LIST_HEAD */
> -#endif
> #include <sys/disk.h>
> #endif
> #ifdef __linux__
> -- 
> 1.8.0
> 


Cheers, Andreas






Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ