projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pthread_sigmask: Fix return value.
[pspp]
/
lib
/
safe-read.c
diff --git
a/lib/safe-read.c
b/lib/safe-read.c
index 391d7896bfc2f59b5c44d51f684a208fa53a7783..d9cb3308d0cc887320d33b1c8b609fc59492b9b6 100644
(file)
--- a/
lib/safe-read.c
+++ b/
lib/safe-read.c
@@
-1,12
+1,12
@@
/* An interface to read and write that retries after interrupts.
/* An interface to read and write that retries after interrupts.
- Copyright (C) 1993
, 1994, 1998, 2002, 2003, 2004
Free Software
+ Copyright (C) 1993
-1994, 1998, 2002-2006, 2009-2011
Free Software
Foundation, Inc.
Foundation, Inc.
- This program is free software
;
you can redistribute it and/or modify
+ This program is free software
:
you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version
2, or (at your option)
- any later version.
+ the Free Software Foundation; either version
3 of the License, or
+
(at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-14,12
+14,9
@@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
/* Specification. */
#ifdef SAFE_WRITE
/* Specification. */
#ifdef SAFE_WRITE
@@
-30,9
+27,7
@@
/* Get ssize_t. */
#include <sys/types.h>
/* Get ssize_t. */
#include <sys/types.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
#include <errno.h>
#include <errno.h>
@@
-71,12
+66,12
@@
safe_rw (int fd, void const *buf, size_t count)
ssize_t result = rw (fd, buf, count);
if (0 <= result)
ssize_t result = rw (fd, buf, count);
if (0 <= result)
- return result;
+
return result;
else if (IS_EINTR (errno))
else if (IS_EINTR (errno))
- continue;
+
continue;
else if (errno == EINVAL && BUGGY_READ_MAXIMUM < count)
else if (errno == EINVAL && BUGGY_READ_MAXIMUM < count)
- count = BUGGY_READ_MAXIMUM;
+
count = BUGGY_READ_MAXIMUM;
else
else
- return result;
+
return result;
}
}
}
}