diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2006-07-11 16:36:19 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2006-07-11 16:36:19 +0000 |
commit | 5d972ef3abebc8f28ec5402622303b5d59928e32 (patch) | |
tree | f3c8d3332f5997c1a23bbeb1fd74f1edf66c17de | |
parent | Check log size before we open it. (diff) | |
download | sandbox-5d972ef3abebc8f28ec5402622303b5d59928e32.tar.gz sandbox-5d972ef3abebc8f28ec5402622303b5d59928e32.tar.bz2 sandbox-5d972ef3abebc8f28ec5402622303b5d59928e32.zip |
Add EINTR check back to sb_open(), as FreeBSD for one seem to be able to fail with errno set to it.
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
-rw-r--r-- | libsbutil/sbio.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libsbutil/sbio.c b/libsbutil/sbio.c index ee1d7e0..a8aa5c7 100644 --- a/libsbutil/sbio.c +++ b/libsbutil/sbio.c @@ -52,7 +52,14 @@ int sb_open(const char *path, int flags, mode_t mode) { int fd; - fd = sbio_open(path, flags, mode); + do { + fd = sbio_open(path, flags, mode); + while ((-1 == fd) && (EINTR == errno)); + + if ((-1 != fd) && (0 != errno)) + /* Do not trigger debugging */ + errno = 0; + if (-1 == fd) DBG_MSG("Failed to open file '%s'!\n", path); |