mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-27 06:45:49 +03:00
Do not create lock for ownCloud Client any more.
This commit is contained in:
parent
b7c03e92da
commit
7b060a7af6
1 changed files with 9 additions and 1 deletions
|
@ -180,7 +180,7 @@ static pid_t _csync_lock_read(CSYNC *ctx, const char *lockfile) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int csync_lock(CSYNC *ctx, const char *lockfile) {
|
int csync_lock(CSYNC *ctx, const char *lockfile) {
|
||||||
#ifndef _WIN32
|
#ifdef _DO_CREATE_A_LOCK_FILE /* disable lock file for ownCloud client, not only _WIN32 */
|
||||||
/* Check if lock already exists. */
|
/* Check if lock already exists. */
|
||||||
if (_csync_lock_read(ctx, lockfile) > 0) {
|
if (_csync_lock_read(ctx, lockfile) > 0) {
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "Aborting, another synchronization process is running.");
|
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "Aborting, another synchronization process is running.");
|
||||||
|
@ -191,12 +191,15 @@ int csync_lock(CSYNC *ctx, const char *lockfile) {
|
||||||
|
|
||||||
return _csync_lock_create(ctx, lockfile);
|
return _csync_lock_create(ctx, lockfile);
|
||||||
#else
|
#else
|
||||||
|
(void) ctx;
|
||||||
|
(void) lockfile;
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void csync_lock_remove(CSYNC *ctx, const char *lockfile) {
|
void csync_lock_remove(CSYNC *ctx, const char *lockfile) {
|
||||||
|
#ifdef _DO_CREATE_A_LOCK_FILE
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
char errbuf[256] = {0};
|
char errbuf[256] = {0};
|
||||||
/* You can't remove the lock if it is from another process */
|
/* You can't remove the lock if it is from another process */
|
||||||
|
@ -211,5 +214,10 @@ void csync_lock_remove(CSYNC *ctx, const char *lockfile) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
(void) ctx;
|
||||||
|
(void) lockfile;
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue