Function

FwupdPlugincommon_spawn_sync

since: 0.9.7

Declaration [src]

gboolean
fu_common_spawn_sync (
  const gchar* const* argv,
  FuOutputHandler handler_cb,
  gpointer handler_user_data,
  guint timeout_ms,
  GCancellable* cancellable,
  GError** error
)

Description [src]

Runs a subprocess and waits for it to exit. Any output on standard out or standard error will be forwarded to handler_cb as whole lines.

Available since: 0.9.7

Parameters

argv

Type: const gchar* const*

The argument list to run.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
handler_cb

Type: FuOutputHandler

Optional FuOutputHandler.

The argument can be NULL.
handler_user_data

Type: gpointer

The user data to pass to handler_cb.

The argument can be NULL.
The data is owned by the caller of the function.
timeout_ms

Type: guint

A timeout in ms, or 0 for no limit.

cancellable

Type: GCancellable

Optional GCancellable.

The argument can be NULL.
The data is owned by the caller of the function.
error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will left initialized to NULL by the function if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: gboolean

TRUE for success.