aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2009-03-17 08:56:27 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2009-03-17 08:56:27 +0000
commitd0240722220985b4ca879c6caa1ca927d5309588 (patch)
treeb0edcf8906ba08caa3f5000f9507de01acc3c2c4 /libsylph
parent56bc524ac9e7eb53b0f4fc7b49b1ebe10a327180 (diff)
abort if fsync() fails.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2122 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/prefs.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libsylph/prefs.c b/libsylph/prefs.c
index 07078d52..56a2eda6 100644
--- a/libsylph/prefs.c
+++ b/libsylph/prefs.c
@@ -397,8 +397,14 @@ gint prefs_file_close(PrefFile *pfile)
goto finish;
}
#if HAVE_FSYNC
- if ((fd = fileno(fp)) >= 0)
- fsync(fd);
+ if ((fd = fileno(fp)) >= 0) {
+ if (fsync(fd) < 0) {
+ FILE_OP_ERROR(tmppath, "fsync");
+ fclose(fp);
+ ret = -1;
+ goto finish;
+ }
+ }
#endif
if (fclose(fp) == EOF) {
FILE_OP_ERROR(tmppath, "fclose");