aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-08-08 02:30:32 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-08-08 02:30:32 +0800
commit1c34dc5138579c3c7855622ae0e0880c55c62f68 (patch)
treef0c247ab0235714de207b19faca94cf561297422
parent3d94bb95601c1b025d4e10ce71fdfd94bd296cf6 (diff)
downloadgsoc2013-evolution-1c34dc5138579c3c7855622ae0e0880c55c62f68.tar
gsoc2013-evolution-1c34dc5138579c3c7855622ae0e0880c55c62f68.tar.gz
gsoc2013-evolution-1c34dc5138579c3c7855622ae0e0880c55c62f68.tar.bz2
gsoc2013-evolution-1c34dc5138579c3c7855622ae0e0880c55c62f68.tar.lz
gsoc2013-evolution-1c34dc5138579c3c7855622ae0e0880c55c62f68.tar.xz
gsoc2013-evolution-1c34dc5138579c3c7855622ae0e0880c55c62f68.tar.zst
gsoc2013-evolution-1c34dc5138579c3c7855622ae0e0880c55c62f68.zip
Do slightly better error handling for close() and loop until it closes
2002-08-07 Jeffrey Stedfast <fejj@ximian.com> * gal/util/e-xml-utils.c (e_xml_save_file): Do slightly better error handling for close() and loop until it closes successfully. svn path=/trunk/; revision=17733
-rw-r--r--e-util/e-xml-utils.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/e-util/e-xml-utils.c b/e-util/e-xml-utils.c
index 6483b4122c..e8f6b0a1b9 100644
--- a/e-util/e-xml-utils.c
+++ b/e-util/e-xml-utils.c
@@ -699,8 +699,8 @@ e_xml_save_file (const char *filename, xmlDocPtr doc)
size_t n, written = 0;
xmlBufferPtr buf;
int errnosave;
+ int ret, fd;
ssize_t w;
- int fd;
filesave = alloca (strlen (filename) + 5);
slash = strrchr (filename, '/');
@@ -742,9 +742,10 @@ e_xml_save_file (const char *filename, xmlDocPtr doc)
return -1;
}
- close (fd);
+ while ((ret = close (fd)) == -1 && errno == EINTR)
+ ;
- if (errno != 0)
+ if (ret == -1)
return -1;
if (rename (filesave, filename) == -1) {