bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error and program_name


From: Bruce Korb
Subject: Re: error and program_name
Date: Thu, 30 Dec 2010 16:19:13 -0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11

On 12/12/10 03:49, Bruno Haible wrote:
> Very good point. The dependency comes from
> 
>   openat     -->  openat-die  -->  error
>   fdopendir

fdopendir --> openat --> ...

> Can you work on breaking this dependency?

I have hacked around it thus and am currently testing:

$ git diff|cat
diff --git a/lib/openat-die.c b/lib/openat-die.c
index a8639e1..2f1f93a 100644
--- a/lib/openat-die.c
+++ b/lib/openat-die.c
@@ -21,7 +21,9 @@

 #include <stdlib.h>

+#ifndef GNULIB_LIBPOSIX
 #include "error.h"
+#endif  GNULIB_LIBPOSIX
 #include "exitfail.h"

 #include "gettext.h"
@@ -30,9 +32,10 @@
 void
 openat_save_fail (int errnum)
 {
+#ifndef GNULIB_LIBPOSIX
   error (exit_failure, errnum,
          _("unable to record current working directory"));
-
+#endif  GNULIB_LIBPOSIX
   /* The `noreturn' attribute cannot be applied to error, since it returns
      when its first argument is 0.  To help compilers understand that this
      function does not return, call abort.  Also, the abort is a
diff --git a/libposix/bootstrap b/libposix/bootstrap
index bfb80ec..0f3f8bc 100755
--- a/libposix/bootstrap
+++ b/libposix/bootstrap
@@ -14,7 +14,7 @@ fi

 posix_list=`
 {   echo alloca
-    posix-modules
+    posix-modules | sed '/^error$/d'
 } | tr -d ' \t' | sed '/^$/d' | sort -u`

 cat > tmp/modules/libposix <<- _EOF_
@@ -41,6 +41,11 @@ cat > tmp/modules/libposix <<- _EOF_
        Gary V. Vaughan
        _EOF_

+for mod in ${posix_list}
+do
+    egrep '^error$' ../modules/${mod} && \
+        sed '/^error$/d' ../modules/${mod} > tmp/modules/${mod}
+done

 opts='--local-dir=tmp
        --import
diff --git a/libposix/configure.ac b/libposix/configure.ac
index b1bd652..db49a02 100644
--- a/libposix/configure.ac
+++ b/libposix/configure.ac
@@ -28,6 +28,7 @@ LT_INIT
 AC_SUBST([LTV_CURRENT], 0)
 AC_SUBST([LTV_REVISION], 0)
 AC_SUBST([LTV_AGE], 0)
+AC_DEFINE_UNQUOTED(GNULIB_LIBPOSIX,1,[we are libposix])

 AC_PROG_CC
 LIBPOSIX_EARLY



reply via email to

[Prev in Thread] Current Thread [Next in Thread]