[Github-comments] [geany] Alter spawn to return the error message only in error->message (#701)
Colomban Wendling
notifications at xxxxx
Wed Oct 21 14:53:28 UTC 2015
> @@ -577,7 +604,83 @@ static gboolean spawn_async_with_pipes(const gchar *working_directory, const gch
>
> spawned = g_spawn_async_with_pipes(working_directory, full_argv, envp,
> G_SPAWN_SEARCH_PATH | (child_pid ? G_SPAWN_DO_NOT_REAP_CHILD : 0), NULL, NULL,
> - child_pid, stdin_fd, stdout_fd, stderr_fd, error);
> + child_pid, stdin_fd, stdout_fd, stderr_fd, &gerror);
> +
> + if (!spawned)
> + {
> + gint en = 0;
> + const gchar *message = gerror->message;
> +
> + /* try to cut glib citing of the program name or working directory: they may be long,
> + and only the caller knows whether they're UTF-8. We lose the exact chdir error. */
> + switch (gerror->code)
hum… I'm not sure I'm fan of such convoluted logic just for shrinking an uncommon string. Isn't that a bit overkill?
---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/701/files#r42633777
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20151021/98855a35/attachment.html>
More information about the Github-comments
mailing list