3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-26 18:12:42 +01:00

storage: Add storage_network_touch

This commit is contained in:
Denis Kenzior 2015-06-16 19:14:33 -05:00
parent 831d702ab2
commit e153d94989
2 changed files with 19 additions and 0 deletions

View File

@ -185,6 +185,24 @@ struct l_settings *storage_network_open(const char *type, const char *ssid)
return settings;
}
int storage_network_touch(const char *type, const char *ssid)
{
char *path;
int ret;
if (ssid == NULL || type == NULL)
return -EINVAL;
path = l_strdup_printf(STORAGEDIR "/%s.%s", ssid, type);
ret = utimensat(0, path, NULL, 0);
l_free(path);
if (!ret)
return 0;
return -errno;
}
void storage_network_sync(const char *type, const char *ssid,
struct l_settings *settings)
{

View File

@ -31,5 +31,6 @@ ssize_t write_file(const void *buffer, size_t len, const char *path_fmt, ...)
__attribute__((format(printf, 3, 4)));
struct l_settings *storage_network_open(const char *type, const char *ssid);
int storage_network_touch(const char *type, const char *ssid);
void storage_network_sync(const char *type, const char *ssid,
struct l_settings *settings);