In contrast to Cygwin 1.5 Cygwin 1.7 doesn't allow to get __argc out of thin air anymore. Instead of finding a workaround I opted to remove the whole command line checking here which was added so revisions ago. The reasoning:
The WinPcap driver presumes to be obligatory for the application. Therefore it quits the whole application if it can't initialize successfully. In former times the WinPcap driver required a cmdline parameter to initialize properly. The netsim target presumably doesn't consider the WinPcap driver obligatory for its applications so it checks the cmdline and starts the WinPcap driver only if it finds the WinPcap cmdline parameter present. Thus it prevents the WinPcap driver from failing to initialize which brings down the whole application. However recently the WinPcap driver was changed to just use some default value if its cmdline parameter isn't found. So there's no more need to keep WinPcap from starting just to make sure it doesn't bring down the whole application. The presumption behind all this reasoning is that a WinPcap driver running with some (potentially wrong) default isn't worse than a WinPcap driver not running at all.
This commit is contained in:
parent
4c26783948
commit
5640f89259
|
@ -30,7 +30,7 @@
|
||||||
*
|
*
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
* Author: Adam Dunkels <adam@sics.se>
|
||||||
*
|
*
|
||||||
* $Id: contiki-main.c,v 1.36 2010/02/23 18:44:08 adamdunkels Exp $
|
* $Id: contiki-main.c,v 1.37 2010/04/21 20:27:28 oliverschmidt Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "contiki.h"
|
#include "contiki.h"
|
||||||
|
@ -70,12 +70,6 @@ int snprintf(char *str, size_t size, const char *format, ...);
|
||||||
#include "dev/radio-sensor.h"
|
#include "dev/radio-sensor.h"
|
||||||
#include "dev/leds.h"
|
#include "dev/leds.h"
|
||||||
|
|
||||||
#ifdef __CYGWIN__
|
|
||||||
__attribute__((dllimport)) extern int __argc;
|
|
||||||
__attribute__((dllimport)) extern char **__argv[];
|
|
||||||
#endif /* __CYGWIN__ */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __CYGWIN__
|
#ifdef __CYGWIN__
|
||||||
static struct uip_fw_netif extif =
|
static struct uip_fw_netif extif =
|
||||||
{UIP_FW_NETIF(0,0,0,0, 0,0,0,0, wpcap_output)};
|
{UIP_FW_NETIF(0,0,0,0, 0,0,0,0, wpcap_output)};
|
||||||
|
@ -135,7 +129,6 @@ contiki_main(int flag)
|
||||||
|
|
||||||
if(flag == 1) {
|
if(flag == 1) {
|
||||||
#ifdef __CYGWIN__
|
#ifdef __CYGWIN__
|
||||||
if(__argc > 2 && (*__argv)[1][0] != '-') {
|
|
||||||
process_start(&wpcap_process, NULL);
|
process_start(&wpcap_process, NULL);
|
||||||
{
|
{
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
@ -152,7 +145,6 @@ contiki_main(int flag)
|
||||||
system(buf);
|
system(buf);
|
||||||
signal(SIGTERM, remove_route);
|
signal(SIGTERM, remove_route);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#else /* __CYGWIN__ */
|
#else /* __CYGWIN__ */
|
||||||
process_start(&tapdev_process, NULL);
|
process_start(&tapdev_process, NULL);
|
||||||
#endif /* __CYGWIN__ */
|
#endif /* __CYGWIN__ */
|
||||||
|
|
Loading…
Reference in a new issue