[csw-maintainers] Question regarding di(1) utility

Dagobert Michelsen dam at opencsw.org
Thu Jun 10 15:35:27 CEST 2010


Hi Brad,

Am 07.06.2010 um 15:47 schrieb Brad Lanam:
> On Mon, Jun 7, 2010 at 01:26, Dagobert Michelsen <dam at opencsw.org>  
> wrote:
>>> Am 07.06.2010 um 04:11 schrieb Philip Brown:
>>>> Am 07.06.2010 um 03:40 schrieb Jeffery Small:
>>>> behavior.  However, when using the new csw di, I am seeing some  
>>>> loopback
>>>> mounts listed.  For example, with the older di:
>
>   Apparently I was writing code from memory and not double checking.
>
>   Line 434 of di.c: #if ! SunOS
>   Should be:         #if ! sun      /* will do for now */
>
>   Looks like I introduced that bug in di-4.20.
>   Unfortunately, there's no easy fix other than recompiling.

Recompiling *is* an easy fix ;-) An updated package is available from
   <http://mirror.opencsw.org/experimental.html#dam>
Please let me know if it works as expected so I can release it to  
current/.

BTW, checking for 'sun' doesn't help, these are defined by Sun Studio:
(from cc(1)):

>           These predefinitions are valid in all modes:
>                    __BUILTIN_VA_ARG_INCR
>                    __SUNPRO_C=0x590
>                    __SVR4(SPARC)
>                    __SunOS(Solaris)
>                    __amd64(x86 with-m64)
>                    __gnu__linux(linux)
>                    __i386(x86)
>                    __linux(linux)
>                    __linux__(linux)
>                    __sparc(SPARC)
>                    __sparcv9(with-m64)
>                    __sun(Solaris)
>                    __unix
>                    __`uname -s`_`uname -r`(Solaris)
>                    __x86_64(x86)
>                    linux(x86,linux)

I now check for __SunOS:

> From 08eae7402b5bbc3dd9e3c3d1227f22c140014c00 Mon Sep 17 00:00:00 2001
> From: Dagobert Michelsen <dam at opencsw.org>
> Date: Thu, 10 Jun 2010 15:23:45 +0200
> Subject: [PATCH] Fix Solaris detection
>
> ---
>  di.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/di.c b/di.c
> index d5adef2..32c3502 100644
> --- a/di.c
> +++ b/di.c
> @@ -431,7 +431,7 @@ main (argc, argv)
>          /* change default display format here */
>      diopts->dispBlockSize = DI_VAL_1024 * DI_VAL_1024;
>      diopts->flags = 0;
> -#if ! SunOS /* Solaris loopback devices should be excluded */
> +#if ! __SunOS /* Solaris loopback devices should be excluded */
>      diopts->flags |= DI_F_INCLUDE_LOOPBACK;
>  #endif
>      strcpy (diopts->sortType, "m"); /* default - sort by mount  
> point */
> -- 
> 1.7.1
>



Best regards

   -- Dago




More information about the maintainers mailing list