Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wsync: implement sync for Windows #2636

Open
markus2330 opened this Issue Apr 15, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@markus2330
Copy link
Contributor

markus2330 commented Apr 15, 2019

As we now (#2631) force "sync" to be present, we should also implement sync for windows. It is a trivial plugin, which only calls FlushFileBuffers:

https://docs.microsoft.com/de-de/windows/desktop/api/fileapi/nf-fileapi-flushfilebuffers

Otherwise the implementation is basically identical to the sync plugin src/plugins/sync/sync.c

const char * configFile = keyString (parentKey);
if (!strcmp (configFile, "")) return 0; // no underlying config file
int fd = open (configFile, O_RDWR);
if (fd == -1)
{
ELEKTRA_SET_ERRORF (89, parentKey, "Could not open config file %s because \"%s\"", configFile, strerror (errno));
return -1;
}
if (fsync (fd) == -1)
{
ELEKTRA_SET_ERRORF (89, parentKey, "Could not fsync config file %s because \"%s\"", configFile, strerror (errno));
close (fd);
return -1;
}
close (fd);
return 1; /* success */

@markus2330 markus2330 added this to the 0.8.27 milestone Apr 15, 2019

@markus2330 markus2330 referenced this issue Apr 15, 2019

Merged

Fixsync #2631

0 of 9 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.