mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-26 10:39:23 +01:00
storage: Add storage_network_touch
This commit is contained in:
parent
831d702ab2
commit
e153d94989
@ -185,6 +185,24 @@ struct l_settings *storage_network_open(const char *type, const char *ssid)
|
|||||||
return settings;
|
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,
|
void storage_network_sync(const char *type, const char *ssid,
|
||||||
struct l_settings *settings)
|
struct l_settings *settings)
|
||||||
{
|
{
|
||||||
|
@ -31,5 +31,6 @@ ssize_t write_file(const void *buffer, size_t len, const char *path_fmt, ...)
|
|||||||
__attribute__((format(printf, 3, 4)));
|
__attribute__((format(printf, 3, 4)));
|
||||||
|
|
||||||
struct l_settings *storage_network_open(const char *type, const char *ssid);
|
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,
|
void storage_network_sync(const char *type, const char *ssid,
|
||||||
struct l_settings *settings);
|
struct l_settings *settings);
|
||||||
|
Loading…
Reference in New Issue
Block a user