diff options
author | 9 <NotZed@Ximian.com> | 2001-09-19 16:28:36 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2001-09-19 16:28:36 +0800 |
commit | bef39dc4e0bbdb334fef71f973bcb7781dce65df (patch) | |
tree | fbb2c1a5fc3d24232d34dbce01edd587e8b84002 /camel/camel-lock.c | |
parent | d9775521cad4588963b2edb297551c85fae1459f (diff) | |
download | gsoc2013-evolution-bef39dc4e0bbdb334fef71f973bcb7781dce65df.tar.gz gsoc2013-evolution-bef39dc4e0bbdb334fef71f973bcb7781dce65df.tar.zst gsoc2013-evolution-bef39dc4e0bbdb334fef71f973bcb7781dce65df.zip |
General cleanup of camel debug printfs.
2001-09-19 <NotZed@Ximian.com>
* General cleanup of camel debug printfs.
* camel-lock.c (camel_lock_fcntl): Changed to return 'success' if
the error indicates file locking isn't supported on this
filesystem. Still return a warning just incase (if its the first
time). Might fix a lot of reported bugs.
* providers/local/camel-spool-store.c (get_folder_info): Dont
include the empty // host part in the uri. This 'breaks' the
service lookup.
svn path=/trunk/; revision=12973
Diffstat (limited to 'camel/camel-lock.c')
-rw-r--r-- | camel/camel-lock.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/camel/camel-lock.c b/camel/camel-lock.c index 1bb2ebc35b..d8064d5eff 100644 --- a/camel/camel-lock.c +++ b/camel/camel-lock.c @@ -198,8 +198,20 @@ camel_lock_fcntl(int fd, CamelLockType type, CamelException *ex) memset(&lock, 0, sizeof(lock)); lock.l_type = type==CAMEL_LOCK_READ?F_RDLCK:F_WRLCK; if (fcntl(fd, F_SETLK, &lock) == -1) { - camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Failed to get lock using fcntl(2): %s"), strerror(errno)); - return -1; + /* If we get a 'locking not vailable' type error, + we assume the filesystem doesn't support fcntl() locking */ + /* this is somewhat system-dependent */ + if (errno != EINVAL && errno != ENOLCK) { + camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Failed to get lock using fcntl(2): %s"), + strerror(errno)); + return -1; + } else { + static int failed = 0; + + if (failed == 0) + fprintf(stderr, "fcntl(2) locking appears not to work on this filesystem"); + failed++; + } } #endif return 0; |