X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=cut-n-paste%2Frecent-files%2Fegg-recent-model.c;h=067a6353f88ee1ae84af31973ecc6782b55e4df0;hb=a54bf6cacb65df7cf50bf3e2d044c9dc4537618a;hp=8b3abe5eaaed964b487e2f34efdced0d89aac7d0;hpb=cd2d70e467e418c1a63e703f3e06df3cb2e92b87;p=evince.git diff --git a/cut-n-paste/recent-files/egg-recent-model.c b/cut-n-paste/recent-files/egg-recent-model.c index 8b3abe5e..067a6353 100644 --- a/cut-n-paste/recent-files/egg-recent-model.c +++ b/cut-n-paste/recent-files/egg-recent-model.c @@ -193,7 +193,9 @@ egg_recent_model_write_raw (EggRecentModel *model, FILE *file, if (fputs (content, file) == EOF) return FALSE; +#ifndef G_OS_WIN32 fsync (fd); +#endif rewind (file); return TRUE; @@ -884,6 +886,7 @@ egg_recent_model_open_file (EggRecentModel *model) static gboolean egg_recent_model_lock_file (FILE *file) { +#ifdef F_TLOCK int fd; gint try = 5; @@ -913,17 +916,24 @@ egg_recent_model_lock_file (FILE *file) } return FALSE; +#else + return TRUE; +#endif } static gboolean egg_recent_model_unlock_file (FILE *file) { +#ifdef F_TLOCK int fd; rewind (file); fd = fileno (file); return (lockf (fd, F_ULOCK, 0) == 0) ? TRUE : FALSE; +#else + return TRUE; +#endif } static void