---
sdhcp.1 | 3 +++
sdhcp.c | 8 ++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/sdhcp.1 b/sdhcp.1
index ef22689..d037624 100644
--- a/sdhcp.1
+++ b/sdhcp.1
_AT_@ -28,6 +28,9 @@ don't change interface information such as an IP address.
.TP
.B "\-e program"
run program. Variables will be set, see VARIABLES.
+.TP
+.B \-f
+run in foreground.
.SH VARIABLES
.LP
The following variables are set:
diff --git a/sdhcp.c b/sdhcp.c
index 9ff9baf..01f0d23 100644
--- a/sdhcp.c
+++ b/sdhcp.c
_AT_@ -97,6 +97,7 @@ static unsigned long t1;
static int dflag = 1; /* change DNS in /etc/resolv.conf ? */
static int iflag = 1; /* set IP ? */
+static int fflag = 0; /* run in foreground */
#define IP(a,b,c,d) (unsigned char[4]){a,b,c,d}
_AT_@ -392,7 +393,7 @@ Requesting:
}
Bound:
fputs("Congrats! You should be on the 'net.\n", stdout);
- if(!forked) {
+ if(!fflag && !forked) {
if(fork())
exit(EXIT_SUCCESS);
forked = 1;
_AT_@ -439,7 +440,7 @@ static void cleanexit(int unused) {
static void
usage(void) {
- eprintf("usage: sdhcp [-i] [-d] [-e program] [ifname] [clientid]\n");
+ eprintf("usage: sdhcp [-i] [-d] [-f] [-e program] [ifname] [clientid]\n");
}
int
_AT_@ -460,6 +461,9 @@ main(int argc, char *argv[])
case 'd': /* don't update DNS in/etc/resolv.conf */
dflag = 0;
break;
+ case 'f': /* run in foreground */
+ fflag = 1;
+ break;
default:
usage();
break;
--
2.1.3.1.g339ec9c
Received on Mon Apr 27 2015 - 03:00:03 CEST
This archive was generated by hypermail 2.3.0 : Mon Apr 27 2015 - 03:12:13 CEST