aboutsummaryrefslogtreecommitdiffstats
path: root/extcap_spawn.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2016-12-07 19:59:53 +0100
committerMichael Mann <mmann78@netscape.net>2016-12-08 21:18:41 +0000
commit6b064e0e145053dbaf96fb0e7b90a46979ce2c8c (patch)
treec308013d3f1ba7e496241400599b3cd06a4486fd /extcap_spawn.c
parentd438170c87c429af914dbc66dd989860dd461960 (diff)
extcap: Whitespace cleanup.
Cleanup code to use uniform whitespace to make it more readable. Also added brackets to unbracketed one line conditional statements. This was done using "astyle -A1cHjk3pU". Change-Id: Iebe96c488c843ce1d790ede0016eb9df025e98a5 Reviewed-on: https://code.wireshark.org/review/19133 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'extcap_spawn.c')
-rw-r--r--extcap_spawn.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/extcap_spawn.c b/extcap_spawn.c
index 7a3984d..80b1cb1 100644
--- a/extcap_spawn.c
+++ b/extcap_spawn.c
@@ -41,7 +41,7 @@
#ifdef _WIN32
-void win32_readfrompipe(HANDLE read_pipe, gint32 max_buffer, gchar * buffer)
+void win32_readfrompipe(HANDLE read_pipe, gint32 max_buffer, gchar *buffer)
{
gboolean bSuccess = FALSE;
gint32 bytes_written = 0;
@@ -68,13 +68,13 @@ void win32_readfrompipe(HANDLE read_pipe, gint32 max_buffer, gchar * buffer)
}
#endif
-gboolean extcap_spawn_sync ( gchar * dirname, gchar * command, gint argc, gchar ** args, gchar ** command_output )
+gboolean extcap_spawn_sync(gchar *dirname, gchar *command, gint argc, gchar **args, gchar **command_output)
{
gboolean status = FALSE;
gboolean result = FALSE;
- gchar ** argv = NULL;
+ gchar **argv = NULL;
gint cnt = 0;
- gchar * local_output = NULL;
+ gchar *local_output = NULL;
#ifdef _WIN32
#define BUFFER_SIZE 4096
@@ -93,8 +93,8 @@ gboolean extcap_spawn_sync ( gchar * dirname, gchar * command, gint argc, gchar
HANDLE child_stderr_rd = NULL;
HANDLE child_stderr_wr = NULL;
- const gchar * oldpath = g_getenv("PATH");
- gchar * newpath = NULL;
+ const gchar *oldpath = g_getenv("PATH");
+ gchar *newpath = NULL;
#else
gint exit_status = 0;
#endif
@@ -110,9 +110,9 @@ gboolean extcap_spawn_sync ( gchar * dirname, gchar * command, gint argc, gchar
argv[0] = g_strdup(command);
#endif
- for ( cnt = 0; cnt < argc; cnt++ )
- argv[cnt+1] = args[cnt];
- argv[argc+1] = NULL;
+ for (cnt = 0; cnt < argc; cnt++)
+ argv[cnt + 1] = args[cnt];
+ argv[argc + 1] = NULL;
#ifdef _WIN32
@@ -179,7 +179,7 @@ gboolean extcap_spawn_sync ( gchar * dirname, gchar * command, gint argc, gchar
#else
status = g_spawn_sync(dirname, argv, NULL,
- (GSpawnFlags) 0, NULL, NULL, &local_output, NULL, &exit_status, NULL);
+ (GSpawnFlags) 0, NULL, NULL, &local_output, NULL, &exit_status, NULL);
if (status && exit_status != 0)
status = FALSE;
@@ -187,7 +187,7 @@ gboolean extcap_spawn_sync ( gchar * dirname, gchar * command, gint argc, gchar
if (status)
{
- if ( command_output != NULL && local_output != NULL )
+ if (command_output != NULL && local_output != NULL)
*command_output = g_strdup(local_output);
result = TRUE;
@@ -200,13 +200,13 @@ gboolean extcap_spawn_sync ( gchar * dirname, gchar * command, gint argc, gchar
return result;
}
-GPid extcap_spawn_async(extcap_userdata * userdata, GPtrArray * args)
+GPid extcap_spawn_async(extcap_userdata *userdata, GPtrArray *args)
{
GPid pid = INVALID_EXTCAP_PID;
#ifdef _WIN32
gint cnt = 0;
- gchar ** tmp = NULL;
+ gchar **tmp = NULL;
GString *winargs = g_string_sized_new(200);
gchar *quoted_arg;
@@ -221,8 +221,8 @@ GPid extcap_spawn_async(extcap_userdata * userdata, GPtrArray * args)
HANDLE child_stderr_rd = NULL;
HANDLE child_stderr_wr = NULL;
- const gchar * oldpath = g_getenv("PATH");
- gchar * newpath = NULL;
+ const gchar *oldpath = g_getenv("PATH");
+ gchar *newpath = NULL;
newpath = g_strdup_printf("%s;%s", g_strescape(get_progfile_dir(), NULL), oldpath);
g_setenv("PATH", newpath, TRUE);
@@ -277,8 +277,8 @@ GPid extcap_spawn_async(extcap_userdata * userdata, GPtrArray * args)
g_setenv("PATH", oldpath, TRUE);
#else
g_spawn_async_with_pipes(NULL, (gchar **)args->pdata, NULL,
- (GSpawnFlags) G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL,
- &pid, NULL, &userdata->extcap_stdout_rd, &userdata->extcap_stderr_rd, NULL);
+ (GSpawnFlags) G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL,
+ &pid, NULL, &userdata->extcap_stdout_rd, &userdata->extcap_stderr_rd, NULL);
#endif
userdata->pid = pid;