mirror of
https://github.com/openwrt/routing.git
synced 2025-02-23 11:36:14 +00:00
- Switch to AUTORELEASE in PKG_RELEASE This avoids cases when someone forgets to bump PKG_RELEASE - Fixed SPDX License Identifier - Changed package versioning Before: vis_1440-2_arm_cortex-a9_vfpv3-d16.ipk After: vis_2013-04-07-7710cce4-1_arm_cortex-a9_vfpv3-d16.ipk - Drop not necessary rows (Some of them were overwritting defaults and it is not necessary) Downloaded tarball is ~2kB smaller Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
57 lines
1.6 KiB
Diff
57 lines
1.6 KiB
Diff
From: Sven Eckelmann <sven@narfation.org>
|
|
Date: Sun, 1 Dec 2013 14:39:00 +0100
|
|
Subject: Allow one to disable forking to background in debug_mode 0
|
|
|
|
---
|
|
posix/init.c | 19 ++++++++++++++-----
|
|
1 file changed, 14 insertions(+), 5 deletions(-)
|
|
|
|
--- a/vis.c
|
|
+++ b/vis.c
|
|
@@ -58,6 +58,7 @@ buffer_t *fillme = NULL;
|
|
|
|
static int8_t stop;
|
|
uint8_t debug_level = 0;
|
|
+static int no_detach = 0;
|
|
|
|
formats selected_formats = dot_draw;
|
|
|
|
@@ -718,6 +719,7 @@ void print_usage() {
|
|
printf( "Usage: vis <interface(s)> \n" );
|
|
printf( "\t-j output mesh topology as json on port %d\n", JSON_PORT );
|
|
printf( "\t-d debug level\n" );
|
|
+ printf( "\t-D run in foreground\n" );
|
|
printf( "\t-h help\n" );
|
|
printf( "\t-v Version\n\n" );
|
|
printf( "Olsrs3d / Meshs3d is an application to visualize a mesh network.\nIt is a part of s3d, have a look at s3d.sourceforge.net\n\n" );
|
|
@@ -738,7 +740,7 @@ int main( int argc, char **argv ) {
|
|
fd_set wait_sockets, tmp_wait_sockets;
|
|
|
|
|
|
- while ( ( optchar = getopt ( argc, argv, "jd:hv" ) ) != -1 ) {
|
|
+ while ( ( optchar = getopt ( argc, argv, "jd:hvD" ) ) != -1 ) {
|
|
|
|
switch( optchar ) {
|
|
|
|
@@ -773,6 +775,11 @@ int main( int argc, char **argv ) {
|
|
selected_formats |= json;
|
|
found_args++;
|
|
break;
|
|
+
|
|
+ case 'D':
|
|
+ no_detach = 1;
|
|
+ found_args++;
|
|
+ break;
|
|
|
|
default:
|
|
print_usage();
|
|
@@ -891,7 +898,7 @@ int main( int argc, char **argv ) {
|
|
|
|
|
|
/* daemonize */
|
|
- if ( debug_level == 0 ) {
|
|
+ if ( debug_level == 0 && !no_detach) {
|
|
|
|
if ( my_daemon() < 0 )
|
|
exit_error( "Error - can't fork to background: %s\n", strerror(errno) );
|