git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
82b05cb
)
Make ofp_error() preserve the value of errno.
author
Ben Pfaff
<blp@nicira.com>
Tue, 30 Sep 2008 19:26:12 +0000
(12:26 -0700)
committer
Ben Pfaff
<blp@nicira.com>
Mon, 6 Oct 2008 16:44:45 +0000
(09:44 -0700)
lib/util.c
patch
|
blob
|
history
diff --git
a/lib/util.c
b/lib/util.c
index
0c70710
..
ff43256
100644
(file)
--- a/
lib/util.c
+++ b/
lib/util.c
@@
-33,6
+33,7
@@
#include <config.h>
#include "util.h"
#include <config.h>
#include "util.h"
+#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@
-138,6
+139,7
@@
ofp_fatal(int err_no, const char *format, ...)
void
ofp_error(int err_no, const char *format, ...)
{
void
ofp_error(int err_no, const char *format, ...)
{
+ int save_errno = errno;
va_list args;
fprintf(stderr, "%s: ", program_name);
va_list args;
fprintf(stderr, "%s: ", program_name);
@@
-147,6
+149,8
@@
ofp_error(int err_no, const char *format, ...)
if (err_no != 0)
fprintf(stderr, " (%s)", strerror(err_no));
putc('\n', stderr);
if (err_no != 0)
fprintf(stderr, " (%s)", strerror(err_no));
putc('\n', stderr);
+
+ errno = save_errno;
}
/* Sets program_name based on 'argv0'. Should be called at the beginning of
}
/* Sets program_name based on 'argv0'. Should be called at the beginning of