summaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-09-06 23:01:06 +0000
committerng0 <ng0@n0.is>2019-09-06 23:01:06 +0000
commitd0051cb6683c712cce3473d6b667208e4f61b75a (patch)
tree99f642c0e8f8c888a2bb3daa5280325dd8707d6d /src/transport
parent6e599264ad13e8fc105493d74d7c11d46f8739ed (diff)
plibc, commit 2
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-helper-transport-wlan-dummy.c128
-rw-r--r--src/transport/gnunet-transport-wlan-receiver.c42
-rw-r--r--src/transport/gnunet-transport-wlan-sender.c127
3 files changed, 157 insertions, 140 deletions
diff --git a/src/transport/gnunet-helper-transport-wlan-dummy.c b/src/transport/gnunet-helper-transport-wlan-dummy.c
index c7ed1b903..0adf8f6a5 100644
--- a/src/transport/gnunet-helper-transport-wlan-dummy.c
+++ b/src/transport/gnunet-helper-transport-wlan-dummy.c
@@ -104,13 +104,14 @@ send_mac_to_plugin (char *buffer, struct GNUNET_TRANSPORT_WLAN_MacAddress *mac)
struct GNUNET_TRANSPORT_WLAN_HelperControlMessage macmsg;
GNUNET_memcpy (&macmsg.mac,
- (char *) mac,
- sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress));
- macmsg.hdr.size = htons (sizeof (struct GNUNET_TRANSPORT_WLAN_HelperControlMessage));
+ (char *) mac,
+ sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress));
+ macmsg.hdr.size =
+ htons (sizeof (struct GNUNET_TRANSPORT_WLAN_HelperControlMessage));
macmsg.hdr.type = htons (GNUNET_MESSAGE_TYPE_WLAN_HELPER_CONTROL);
GNUNET_memcpy (buffer,
- &macmsg,
- sizeof (struct GNUNET_TRANSPORT_WLAN_HelperControlMessage));
+ &macmsg,
+ sizeof (struct GNUNET_TRANSPORT_WLAN_HelperControlMessage));
return sizeof (struct GNUNET_TRANSPORT_WLAN_HelperControlMessage);
}
@@ -126,8 +127,7 @@ send_mac_to_plugin (char *buffer, struct GNUNET_TRANSPORT_WLAN_MacAddress *mac)
* #GNUNET_SYSERR to stop further processing with error
*/
static int
-stdin_send (void *cls,
- const struct GNUNET_MessageHeader *hdr)
+stdin_send (void *cls, const struct GNUNET_MessageHeader *hdr)
{
struct SendBuffer *write_pout = cls;
const struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *in;
@@ -137,16 +137,19 @@ stdin_send (void *cls,
sendsize = ntohs (hdr->size);
in = (const struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *) hdr;
- if ( (GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER != ntohs (hdr->type)) ||
- (sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage) > sendsize) )
+ if ((GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER != ntohs (hdr->type)) ||
+ (sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage) > sendsize))
{
fprintf (stderr, "%s", "Received malformed message\n");
exit (1);
}
- payload_size = sendsize - sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage);
- if ((payload_size + sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage) + write_pout->size) > MAXLINE * 2)
+ payload_size =
+ sendsize - sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage);
+ if ((payload_size +
+ sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage) +
+ write_pout->size) > MAXLINE * 2)
{
- fprintf (stderr, "%s", "Packet too big for buffer\n");
+ fprintf (stderr, "%s", "Packet too big for buffer\n");
exit (1);
}
memset (&newheader, 0, sizeof (newheader));
@@ -154,12 +157,10 @@ stdin_send (void *cls,
newheader.header.type = htons (GNUNET_MESSAGE_TYPE_WLAN_DATA_FROM_HELPER);
newheader.frame = in->frame;
GNUNET_memcpy (write_pout->buf + write_pout->size,
- &newheader,
- sizeof (newheader));
+ &newheader,
+ sizeof (newheader));
write_pout->size += sizeof (newheader);
- GNUNET_memcpy (write_pout->buf + write_pout->size,
- &in[1],
- payload_size);
+ GNUNET_memcpy (write_pout->buf + write_pout->size, &in[1], payload_size);
write_pout->size += payload_size;
return GNUNET_OK;
}
@@ -175,8 +176,7 @@ stdin_send (void *cls,
* #GNUNET_SYSERR to stop further processing with error
*/
static int
-file_in_send (void *cls,
- const struct GNUNET_MessageHeader *hdr)
+file_in_send (void *cls, const struct GNUNET_MessageHeader *hdr)
{
struct SendBuffer *write_std = cls;
uint16_t sendsize;
@@ -224,45 +224,46 @@ main (int argc, char *argv[])
struct GNUNET_TRANSPORT_WLAN_MacAddress macaddr;
int first;
- if ( (2 != argc) ||
- ((0 != strcmp (argv[1], "1")) && (0 != strcmp (argv[1], "2"))) )
+ if ((2 != argc) ||
+ ((0 != strcmp (argv[1], "1")) && (0 != strcmp (argv[1], "2"))))
{
- fprintf (stderr,
- "%s",
- "This program must be started with the operating mode (1 or 2) as the only argument.\n");
+ fprintf (
+ stderr,
+ "%s",
+ "This program must be started with the operating mode (1 or 2) as the only argument.\n");
return 1;
}
/* make the fifos if needed */
umask (0);
- if ( (GNUNET_OK != GNUNET_DISK_directory_create_for_file (FIFO_FILE1)) ||
- (GNUNET_OK != GNUNET_DISK_directory_create_for_file (FIFO_FILE2)) )
+ if ((GNUNET_OK != GNUNET_DISK_directory_create_for_file (FIFO_FILE1)) ||
+ (GNUNET_OK != GNUNET_DISK_directory_create_for_file (FIFO_FILE2)))
{
- fprintf (stderr,
- "Failed to create directory for file `%s'\n",
- FIFO_FILE1);
+ fprintf (stderr, "Failed to create directory for file `%s'\n", FIFO_FILE1);
return 1;
}
- if (0 == strcmp (argv[1], "1") )
+ if (0 == strcmp (argv[1], "1"))
{
if (0 != stat (FIFO_FILE1, &st))
{
erg = mkfifo (FIFO_FILE1, 0666);
- if ( (0 != erg) && (EEXIST != errno) )
- fprintf (stderr, "Error in mkfifo(%s): %s\n", FIFO_FILE1,
- strerror (errno));
+ if ((0 != erg) && (EEXIST != errno))
+ fprintf (stderr,
+ "Error in mkfifo(%s): %s\n",
+ FIFO_FILE1,
+ strerror (errno));
}
}
else
{
if (0 != stat (FIFO_FILE2, &st))
{
- GNUNET_break (0 == (erg = mkfifo (FIFO_FILE2, 0666)));
- if ( (0 != erg) && (EEXIST != errno) )
- fprintf (stderr,
+ GNUNET_break (0 == (erg = mkfifo (FIFO_FILE2, 0666)));
+ if ((0 != erg) && (EEXIST != errno))
+ fprintf (stderr,
"Error in mkfifo(%s): %s\n",
FIFO_FILE2,
- strerror (errno));
+ strerror (errno));
}
}
@@ -274,7 +275,7 @@ main (int argc, char *argv[])
{
fprintf (stderr,
"fopen of read FIFO_FILE1 failed: %s\n",
- STRERROR (errno));
+ strerror (errno));
goto end;
}
if (NULL == (fpout = fopen (FIFO_FILE2, "w")))
@@ -286,7 +287,7 @@ main (int argc, char *argv[])
{
fprintf (stderr,
"fopen of write FIFO_FILE2 failed: %s\n",
- STRERROR (errno));
+ strerror (errno));
goto end;
}
}
@@ -295,14 +296,14 @@ main (int argc, char *argv[])
first = 0;
if (NULL == (fpout = fopen (FIFO_FILE1, "w")))
{
- GNUNET_break (0 == mkfifo (FIFO_FILE1, 0666));
+ GNUNET_break (0 == mkfifo (FIFO_FILE1, 0666));
fpout = fopen (FIFO_FILE1, "w");
}
if (NULL == fpout)
{
fprintf (stderr,
"fopen of write FIFO_FILE1 failed: %s\n",
- STRERROR (errno));
+ strerror (errno));
goto end;
}
fpin = fopen (FIFO_FILE2, "r");
@@ -310,7 +311,7 @@ main (int argc, char *argv[])
{
fprintf (stderr,
"fopen of read FIFO_FILE2 failed: %s\n",
- STRERROR (errno));
+ strerror (errno));
goto end;
}
}
@@ -395,21 +396,22 @@ main (int argc, char *argv[])
continue;
if (0 > retval)
{
- fprintf (stderr, "select failed: %s\n", STRERROR (errno));
+ fprintf (stderr, "select failed: %s\n", strerror (errno));
closeprog = 1;
break;
}
if (FD_ISSET (STDOUT_FILENO, &wfds))
{
- ret =
- write (STDOUT_FILENO, write_std.buf + write_std.pos,
- write_std.size - write_std.pos);
+ ret = write (STDOUT_FILENO,
+ write_std.buf + write_std.pos,
+ write_std.size - write_std.pos);
if (0 > ret)
{
closeprog = 1;
- fprintf (stderr, "Write ERROR to STDOUT_FILENO: %s\n",
- STRERROR (errno));
+ fprintf (stderr,
+ "Write ERROR to STDOUT_FILENO: %s\n",
+ strerror (errno));
break;
}
else
@@ -426,14 +428,16 @@ main (int argc, char *argv[])
if (FD_ISSET (fdpout, &wfds))
{
- ret =
- write (fdpout, write_pout.buf + write_pout.pos,
- write_pout.size - write_pout.pos);
+ ret = write (fdpout,
+ write_pout.buf + write_pout.pos,
+ write_pout.size - write_pout.pos);
if (0 > ret)
{
closeprog = 1;
- fprintf (stderr, "Write ERROR to fdpout failed: %s\n", STRERROR (errno));
+ fprintf (stderr,
+ "Write ERROR to fdpout failed: %s\n",
+ strerror (errno));
}
else
{
@@ -454,15 +458,17 @@ main (int argc, char *argv[])
if (0 > readsize)
{
closeprog = 1;
- fprintf (stderr, "Error reading from STDIN_FILENO: %s\n",
- STRERROR (errno));
+ fprintf (stderr,
+ "Error reading from STDIN_FILENO: %s\n",
+ strerror (errno));
}
else if (0 < readsize)
{
GNUNET_MST_from_buffer (stdin_mst,
- readbuf, readsize,
- GNUNET_NO, GNUNET_NO);
-
+ readbuf,
+ readsize,
+ GNUNET_NO,
+ GNUNET_NO);
}
else
{
@@ -477,14 +483,16 @@ main (int argc, char *argv[])
if (0 > readsize)
{
closeprog = 1;
- fprintf (stderr, "Error reading from fdpin: %s\n", STRERROR (errno));
+ fprintf (stderr, "Error reading from fdpin: %s\n", strerror (errno));
break;
}
else if (0 < readsize)
{
GNUNET_MST_from_buffer (file_in_mst,
- readbuf, readsize,
- GNUNET_NO, GNUNET_NO);
+ readbuf,
+ readsize,
+ GNUNET_NO,
+ GNUNET_NO);
}
else
{
diff --git a/src/transport/gnunet-transport-wlan-receiver.c b/src/transport/gnunet-transport-wlan-receiver.c
index 04f30a683..9b31377e7 100644
--- a/src/transport/gnunet-transport-wlan-receiver.c
+++ b/src/transport/gnunet-transport-wlan-receiver.c
@@ -37,7 +37,7 @@ main (int argc, char *argv[])
time_t akt;
ssize_t ret;
pid_t pid;
- int commpipe[2]; /* This holds the fd for the input & output of the pipe */
+ int commpipe[2]; /* This holds the fd for the input & output of the pipe */
if (2 != argc)
{
@@ -46,34 +46,30 @@ main (int argc, char *argv[])
fprintf (stderr,
"Usage: %s interface-name\n"
"e.g. %s mon0\n",
- argv[0], argv[0]);
+ argv[0],
+ argv[0]);
return 1;
}
/* Setup communication pipeline first */
if (pipe (commpipe))
{
- fprintf (stderr,
- "Failed to create pipe: %s\n",
- STRERROR (errno));
+ fprintf (stderr, "Failed to create pipe: %s\n", strerror (errno));
exit (1);
}
/* Attempt to fork and check for errors */
if ((pid = fork ()) == -1)
{
- fprintf (stderr, "Failed to fork: %s\n",
- STRERROR (errno));
+ fprintf (stderr, "Failed to fork: %s\n", strerror (errno));
exit (1);
}
if (pid)
{
/* A positive (non-negative) PID indicates the parent process */
- if (0 != close (commpipe[1])) /* Close unused side of pipe (in side) */
- fprintf (stderr,
- "Failed to close fd: %s\n",
- strerror (errno));
+ if (0 != close (commpipe[1])) /* Close unused side of pipe (in side) */
+ fprintf (stderr, "Failed to close fd: %s\n", strerror (errno));
start = time (NULL);
count = 0;
while (1)
@@ -81,18 +77,18 @@ main (int argc, char *argv[])
ret = read (commpipe[0], msg_buf, sizeof (msg_buf));
if (0 > ret)
{
- fprintf (stderr, "read failed: %s\n", strerror (errno));
- break;
+ fprintf (stderr, "read failed: %s\n", strerror (errno));
+ break;
}
count += ret;
akt = time (NULL);
if (akt - start > 30)
{
- bytes_per_s = count / (akt - start);
- bytes_per_s /= 1024;
- printf ("recv %f kb/s\n", bytes_per_s);
- start = akt;
- count = 0;
+ bytes_per_s = count / (akt - start);
+ bytes_per_s /= 1024;
+ printf ("recv %f kb/s\n", bytes_per_s);
+ start = akt;
+ count = 0;
}
}
}
@@ -100,13 +96,15 @@ main (int argc, char *argv[])
{
/* A zero PID indicates that this is the child process */
(void) close (1);
- if (-1 == dup2 (commpipe[1], 1)) /* Replace stdin with the in side of the pipe */
+ if (-1 ==
+ dup2 (commpipe[1], 1)) /* Replace stdin with the in side of the pipe */
fprintf (stderr, "dup2 failed: %s\n", strerror (errno));
(void) close (commpipe[0]); /* Close unused side of pipe (in side) */
/* Replace the child fork with a new process */
- if (execlp
- ("gnunet-helper-transport-wlan", "gnunet-helper-transport-wlan",
- argv[1], NULL) == -1)
+ if (execlp ("gnunet-helper-transport-wlan",
+ "gnunet-helper-transport-wlan",
+ argv[1],
+ NULL) == -1)
{
fprintf (stderr, "Could not start gnunet-helper-transport-wlan!");
_exit (1);
diff --git a/src/transport/gnunet-transport-wlan-sender.c b/src/transport/gnunet-transport-wlan-sender.c
index 36d26f8dc..36273f765 100644
--- a/src/transport/gnunet-transport-wlan-sender.c
+++ b/src/transport/gnunet-transport-wlan-sender.c
@@ -35,16 +35,16 @@
#define WLAN_LLC_DSAP_FIELD 0x1f
#define WLAN_LLC_SSAP_FIELD 0x1f
-#define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */
+#define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */
-#define IEEE80211_FC0_VERSION_MASK 0x03
-#define IEEE80211_FC0_VERSION_SHIFT 0
-#define IEEE80211_FC0_VERSION_0 0x00
-#define IEEE80211_FC0_TYPE_MASK 0x0c
-#define IEEE80211_FC0_TYPE_SHIFT 2
-#define IEEE80211_FC0_TYPE_MGT 0x00
-#define IEEE80211_FC0_TYPE_CTL 0x04
-#define IEEE80211_FC0_TYPE_DATA 0x08
+#define IEEE80211_FC0_VERSION_MASK 0x03
+#define IEEE80211_FC0_VERSION_SHIFT 0
+#define IEEE80211_FC0_VERSION_0 0x00
+#define IEEE80211_FC0_TYPE_MASK 0x0c
+#define IEEE80211_FC0_TYPE_SHIFT 2
+#define IEEE80211_FC0_TYPE_MGT 0x00
+#define IEEE80211_FC0_TYPE_CTL 0x04
+#define IEEE80211_FC0_TYPE_DATA 0x08
/**
@@ -55,7 +55,7 @@
*/
static int
getRadiotapHeader (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *header,
- uint16_t size)
+ uint16_t size)
{
header->header.size = htons (size);
header->header.type = htons (GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER);
@@ -75,8 +75,9 @@ getRadiotapHeader (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *header,
*/
static int
getWlanHeader (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame *Header,
- const struct GNUNET_TRANSPORT_WLAN_MacAddress *to_mac_addr,
- const struct GNUNET_TRANSPORT_WLAN_MacAddress *mac, unsigned int size)
+ const struct GNUNET_TRANSPORT_WLAN_MacAddress *to_mac_addr,
+ const struct GNUNET_TRANSPORT_WLAN_MacAddress *mac,
+ unsigned int size)
{
const int rate = 11000000;
@@ -109,21 +110,27 @@ main (int argc, char *argv[])
int i;
ssize_t ret;
pid_t pid;
- int commpipe[2]; /* This holds the fd for the input & output of the pipe */
- int macpipe[2]; /* This holds the fd for the input & output of the pipe */
+ int commpipe[2]; /* This holds the fd for the input & output of the pipe */
+ int macpipe[2]; /* This holds the fd for the input & output of the pipe */
if (4 != argc)
{
- fprintf (stderr,
- "This program must be started with the interface and the targets and source mac as argument.\n");
+ fprintf (
+ stderr,
+ "This program must be started with the interface and the targets and source mac as argument.\n");
fprintf (stderr,
"Usage: interface-name mac-DST mac-SRC\n"
"e.g. mon0 11-22-33-44-55-66 12-34-56-78-90-ab\n");
return 1;
}
- if (6 !=
- SSCANF (argv[2], "%x-%x-%x-%x-%x-%x", &temp[0], &temp[1], &temp[2],
- &temp[3], &temp[4], &temp[5]))
+ if (6 != SSCANF (argv[2],
+ "%x-%x-%x-%x-%x-%x",
+ &temp[0],
+ &temp[1],
+ &temp[2],
+ &temp[3],
+ &temp[4],
+ &temp[5]))
{
fprintf (stderr,
"Usage: interface-name mac-DST mac-SRC\n"
@@ -132,9 +139,14 @@ main (int argc, char *argv[])
}
for (i = 0; i < 6; i++)
outmac.mac[i] = temp[i];
- if (6 !=
- SSCANF (argv[3], "%x-%x-%x-%x-%x-%x", &temp[0], &temp[1], &temp[2],
- &temp[3], &temp[4], &temp[5]))
+ if (6 != SSCANF (argv[3],
+ "%x-%x-%x-%x-%x-%x",
+ &temp[0],
+ &temp[1],
+ &temp[2],
+ &temp[3],
+ &temp[4],
+ &temp[5]))
{
fprintf (stderr,
"Usage: interface-name mac-DST mac-SRC\n"
@@ -148,51 +160,47 @@ main (int argc, char *argv[])
/* Setup communication pipeline first */
if (pipe (commpipe))
{
- fprintf (stderr,
- "Failed to create pipe: %s\n",
- STRERROR (errno));
+ fprintf (stderr, "Failed to create pipe: %s\n", strerror (errno));
exit (1);
}
if (pipe (macpipe))
{
- fprintf (stderr,
- "Failed to create pipe: %s\n",
- STRERROR (errno));
+ fprintf (stderr, "Failed to create pipe: %s\n", strerror (errno));
exit (1);
}
/* Attempt to fork and check for errors */
if ((pid = fork ()) == -1)
{
- fprintf (stderr, "Failed to fork: %s\n",
- STRERROR (errno));
+ fprintf (stderr, "Failed to fork: %s\n", strerror (errno));
exit (1);
}
memset (msg_buf, 0x42, sizeof (msg_buf));
if (pid)
{
/* A positive (non-negative) PID indicates the parent process */
- if (0 != close (commpipe[0])) /* Close unused side of pipe (in side) */
- fprintf (stderr,
- "Failed to close fd: %s\n",
- strerror (errno));
- setvbuf (stdout, (char *) NULL, _IONBF, 0); /* Set non-buffered output on stdout */
+ if (0 != close (commpipe[0])) /* Close unused side of pipe (in side) */
+ fprintf (stderr, "Failed to close fd: %s\n", strerror (errno));
+ setvbuf (stdout,
+ (char *) NULL,
+ _IONBF,
+ 0); /* Set non-buffered output on stdout */
if (0 != close (macpipe[1]))
- fprintf (stderr,
- "Failed to close fd: %s\n",
- strerror (errno));
+ fprintf (stderr, "Failed to close fd: %s\n", strerror (errno));
if (sizeof (hcm) != read (macpipe[0], &hcm, sizeof (hcm)))
- fprintf (stderr,
- "Failed to read hcm...\n");
+ fprintf (stderr, "Failed to read hcm...\n");
fprintf (stderr,
- "Got MAC %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\n",
- hcm.mac.mac[0], hcm.mac.mac[1],
- hcm.mac.mac[2], hcm.mac.mac[3], hcm.mac.mac[4], hcm.mac.mac[5]);
+ "Got MAC %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\n",
+ hcm.mac.mac[0],
+ hcm.mac.mac[1],
+ hcm.mac.mac[2],
+ hcm.mac.mac[3],
+ hcm.mac.mac[4],
+ hcm.mac.mac[5]);
radiotap = (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *) msg_buf;
getRadiotapHeader (radiotap, WLAN_MTU);
- getWlanHeader (&radiotap->frame, &outmac, &inmac,
- WLAN_MTU);
+ getWlanHeader (&radiotap->frame, &outmac, &inmac, WLAN_MTU);
start = time (NULL);
count = 0;
while (1)
@@ -200,18 +208,18 @@ main (int argc, char *argv[])
ret = write (commpipe[1], msg_buf, WLAN_MTU);
if (0 > ret)
{
- fprintf (stderr, "write failed: %s\n", strerror (errno));
- break;
+ fprintf (stderr, "write failed: %s\n", strerror (errno));
+ break;
}
count += ret;
- akt = time (NULL);
+ akt = time (NULL);
if (akt - start > 30)
{
- bytes_per_s = count / (akt - start);
- bytes_per_s /= 1024;
- printf ("send %f kbytes/s\n", bytes_per_s);
- start = akt;
- count = 0;
+ bytes_per_s = count / (akt - start);
+ bytes_per_s /= 1024;
+ printf ("send %f kbytes/s\n", bytes_per_s);
+ start = akt;
+ count = 0;
}
}
}
@@ -220,16 +228,19 @@ main (int argc, char *argv[])
/* A zero PID indicates that this is the child process */
(void) close (0);
(void) close (1);
- if (-1 == dup2 (commpipe[0], 0)) /* Replace stdin with the in side of the pipe */
+ if (-1 ==
+ dup2 (commpipe[0], 0)) /* Replace stdin with the in side of the pipe */
fprintf (stderr, "dup2 failed: %s\n", strerror (errno));
- if (-1 == dup2 (macpipe[1], 1)) /* Replace stdout with the out side of the pipe */
+ if (-1 ==
+ dup2 (macpipe[1], 1)) /* Replace stdout with the out side of the pipe */
fprintf (stderr, "dup2 failed: %s\n", strerror (errno));
(void) close (commpipe[1]); /* Close unused side of pipe (out side) */
(void) close (macpipe[0]); /* Close unused side of pipe (in side) */
/* Replace the child fork with a new process */
- if (execlp
- ("gnunet-helper-transport-wlan", "gnunet-helper-transport-wlan",
- argv[1], NULL) == -1)
+ if (execlp ("gnunet-helper-transport-wlan",
+ "gnunet-helper-transport-wlan",
+ argv[1],
+ NULL) == -1)
{
fprintf (stderr, "Could not start gnunet-helper-transport-wlan!");
_exit (1);