The following commit has been merged in the master branch:
commit decb92e45369aea1969c3e3220610728bc36ceb6
Author: Guillem Jover <[EMAIL PROTECTED]>
Date:   Fri Dec 5 06:55:24 2008 +0200

    libdpkg: Make warning() not implicitly print the errno string
    
    The callers who want the errno string should call strerror().

diff --git a/ChangeLog b/ChangeLog
index ee9f526..b88bc59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-12-05  Guillem Jover  <[EMAIL PROTECTED]>
 
+       * lib/ehandle.c (warning): Do not implicitly print the errno string.
+       * lib/myopt.c (myfileopt): Print the errno string in the warning.
+
+2008-12-05  Guillem Jover  <[EMAIL PROTECTED]>
+
        * lib/dpkg.h (warningf): Rename to ...
        (warning): ... this. Fix all callers.
 
diff --git a/lib/ehandle.c b/lib/ehandle.c
index 55ceb77..ec963b3 100644
--- a/lib/ehandle.c
+++ b/lib/ehandle.c
@@ -292,16 +292,14 @@ void ohshite(const char *fmt, ...) {
 void
 warning(const char *fmt, ...)
 {
-  int e;
   va_list al;
   char buf[1024];
 
-  e=errno;
   va_start(al,fmt);
   vsnprintf(buf,sizeof(buf),fmt,al);
   va_end(al);
 
-  fprintf(stderr,"%s: %s\n",buf,strerror(e));
+  fprintf(stderr, "%s\n", buf);
 }
 
 void badusage(const char *fmt, ...) {
diff --git a/lib/myopt.c b/lib/myopt.c
index a47da4e..d119ad5 100644
--- a/lib/myopt.c
+++ b/lib/myopt.c
@@ -40,7 +40,8 @@ void myfileopt(const char* fn, const struct cmdinfo* 
cmdinfos) {
   if (!file) {
     if (errno==ENOENT)
       return;
-    warning(_("failed to open configuration file `%.255s' for reading"), fn);
+    warning(_("failed to open configuration file '%.255s' for reading: %s"),
+            fn, strerror(errno));
     return;
   }
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to