hostname: rename nm_hostname_manager_write_hostname() to set_static_hostname()
This commit is contained in:
@@ -433,11 +433,11 @@ _write_hostname_on_idle_cb(gpointer user_data, GCancellable *cancellable)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nm_hostname_manager_write_hostname(NMHostnameManager *self,
|
nm_hostname_manager_set_static_hostname(NMHostnameManager *self,
|
||||||
const char *hostname,
|
const char *hostname,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
NMHostnameManagerPrivate *priv;
|
NMHostnameManagerPrivate *priv;
|
||||||
GTask *task;
|
GTask *task;
|
||||||
@@ -446,8 +446,11 @@ nm_hostname_manager_write_hostname(NMHostnameManager *self,
|
|||||||
|
|
||||||
priv = NM_HOSTNAME_MANAGER_GET_PRIVATE(self);
|
priv = NM_HOSTNAME_MANAGER_GET_PRIVATE(self);
|
||||||
|
|
||||||
task =
|
task = nm_g_task_new(self,
|
||||||
nm_g_task_new(self, cancellable, nm_hostname_manager_write_hostname, callback, user_data);
|
cancellable,
|
||||||
|
nm_hostname_manager_set_static_hostname,
|
||||||
|
callback,
|
||||||
|
user_data);
|
||||||
|
|
||||||
g_task_set_task_data(task, g_strdup(hostname), g_free);
|
g_task_set_task_data(task, g_strdup(hostname), g_free);
|
||||||
|
|
||||||
@@ -467,12 +470,12 @@ nm_hostname_manager_write_hostname(NMHostnameManager *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
nm_hostname_manager_write_hostname_finish(NMHostnameManager *self,
|
nm_hostname_manager_set_static_hostname_finish(NMHostnameManager *self,
|
||||||
GAsyncResult *result,
|
GAsyncResult *result,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail(NM_IS_HOSTNAME_MANAGER(self), FALSE);
|
g_return_val_if_fail(NM_IS_HOSTNAME_MANAGER(self), FALSE);
|
||||||
g_return_val_if_fail(nm_g_task_is_valid(result, self, nm_hostname_manager_write_hostname),
|
g_return_val_if_fail(nm_g_task_is_valid(result, self, nm_hostname_manager_set_static_hostname),
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
return g_task_propagate_boolean(G_TASK(result), error);
|
return g_task_propagate_boolean(G_TASK(result), error);
|
||||||
|
@@ -36,15 +36,15 @@ NMHostnameManager *nm_hostname_manager_get(void);
|
|||||||
|
|
||||||
const char *nm_hostname_manager_get_static_hostname(NMHostnameManager *self);
|
const char *nm_hostname_manager_get_static_hostname(NMHostnameManager *self);
|
||||||
|
|
||||||
void nm_hostname_manager_write_hostname(NMHostnameManager *self,
|
void nm_hostname_manager_set_static_hostname(NMHostnameManager *self,
|
||||||
const char *hostname,
|
const char *hostname,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
gboolean nm_hostname_manager_write_hostname_finish(NMHostnameManager *self,
|
gboolean nm_hostname_manager_set_static_hostname_finish(NMHostnameManager *self,
|
||||||
GAsyncResult *result,
|
GAsyncResult *result,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
void nm_hostname_manager_set_transient_hostname(NMHostnameManager *self,
|
void nm_hostname_manager_set_transient_hostname(NMHostnameManager *self,
|
||||||
const char *hostname,
|
const char *hostname,
|
||||||
|
@@ -3479,7 +3479,7 @@ _save_hostname_write_cb(GObject *source, GAsyncResult *result, gpointer user_dat
|
|||||||
|
|
||||||
nm_utils_user_data_unpack(user_data, &self, &context, &auth_subject, &hostname, &cancellable);
|
nm_utils_user_data_unpack(user_data, &self, &context, &auth_subject, &hostname, &cancellable);
|
||||||
|
|
||||||
nm_hostname_manager_write_hostname_finish(NM_HOSTNAME_MANAGER(source), result, &error);
|
nm_hostname_manager_set_static_hostname_finish(NM_HOSTNAME_MANAGER(source), result, &error);
|
||||||
|
|
||||||
nm_audit_log_control_op(NM_AUDIT_OP_HOSTNAME_SAVE,
|
nm_audit_log_control_op(NM_AUDIT_OP_HOSTNAME_SAVE,
|
||||||
hostname ?: "",
|
hostname ?: "",
|
||||||
@@ -3544,7 +3544,7 @@ _save_hostname_pk_cb(NMAuthChain *chain, GDBusMethodInvocation *context, gpointe
|
|||||||
(gpointer *) &priv->shutdown_cancellable);
|
(gpointer *) &priv->shutdown_cancellable);
|
||||||
}
|
}
|
||||||
|
|
||||||
nm_hostname_manager_write_hostname(
|
nm_hostname_manager_set_static_hostname(
|
||||||
priv->hostname_manager,
|
priv->hostname_manager,
|
||||||
hostname,
|
hostname,
|
||||||
priv->shutdown_cancellable,
|
priv->shutdown_cancellable,
|
||||||
|
Reference in New Issue
Block a user