mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Replace chmod by _wchmod on Windows.
To unlink the lock file we need write-access on it. As g_chmod is new in GLib 2.8, use _wchmod directly. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15429 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -288,7 +288,13 @@ file_session_end(QofBackend *be_start)
|
||||
#ifdef G_OS_WIN32
|
||||
/* On windows, we need to allow write-access before
|
||||
g_unlink() can succeed */
|
||||
rv = chmod (be->lockfile, S_IWRITE | S_IREAD);
|
||||
wchar_t *wlock = g_utf8_to_utf16 (be->lockfile, -1, NULL, NULL, NULL);
|
||||
if (wlock) {
|
||||
rv = _wchmod (wlock, _S_IWRITE);
|
||||
} else {
|
||||
errno = EINVAL;
|
||||
rv = 1;
|
||||
}
|
||||
if (rv) {
|
||||
PWARN("Error on chmod(%s): %d: %s", be->lockfile,
|
||||
errno, strerror(errno) ? strerror(errno) : "");
|
||||
|
||||
Reference in New Issue
Block a user