diff options
author | Guillem Jover <guillem@debian.org> | 2008-12-05 06:55:24 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2008-12-05 06:55:24 +0200 |
commit | decb92e45369aea1969c3e3220610728bc36ceb6 (patch) | |
tree | cb314efa8489a3dfcc4a9cd70d2c8cb2191b1a42 /lib | |
parent | 778eaba6b21678a54cf0f83a960f93f65bc83742 (diff) | |
download | dpkg-decb92e45369aea1969c3e3220610728bc36ceb6.tar.gz |
libdpkg: Make warning() not implicitly print the errno string
The callers who want the errno string should call strerror().
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ehandle.c | 4 | ||||
-rw-r--r-- | lib/myopt.c | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/ehandle.c b/lib/ehandle.c index 55ceb77f9..ec963b318 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 a47da4eee..d119ad5ee 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; } |