OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

  1. diff -up dhcprelay-1.2/dhcprelay.c.foreground dhcprelay-1.2/dhcprelay.c
  2. --- dhcprelay-1.2/dhcprelay.c.foreground 2011-01-11 13:46:12.985241996 +0100
  3. +++ dhcprelay-1.2/dhcprelay.c 2011-01-11 13:53:32.135116637 +0100
  4. @@ -53,6 +53,7 @@ struct request {
  5. struct request *requests=NULL;
  6. int DEBUG=0;
  7. +int FOREGROUND=0;
  8. int bootpc_port=0;
  9. int bootps_port=0;
  10. @@ -74,13 +75,18 @@ char *wait=".oOo";
  11. int main(int argc,char **argv) {
  12. int waitcounter=0;
  13. - while (argc>1 && strcmp(argv[1],"-d")==0) {
  14. - DEBUG++;
  15. + while (argc>1) {
  16. + if (strcmp(argv[1],"-d")==0) {
  17. + DEBUG++;
  18. + } else if (strcmp(argv[1],"-f")!=0) {
  19. + break;
  20. + }
  21. + FOREGROUND++;
  22. argv++;
  23. argc--;
  24. }
  25. - if (DEBUG==0) {
  26. + if (FOREGROUND==0) {
  27. pid_t p;
  28. if (fork()) {
  29. sleep(3);
  30. @@ -114,7 +120,7 @@ int main(int argc,char **argv) {
  31. if (argc==1) {
  32. printf(
  33. - "Usage: %s [-d] <interface[:ipaddress]> <dhcpserver>\n"
  34. + "Usage: %s [-d|-f] <interface[:ipaddress]> <dhcpserver>\n"
  35. "Example: %s fxp0 10.192.0.1\n"
  36. "Example: %s fxp0:192.168.1.1 10.192.0.1\n",
  37. argv[0],argv[0],argv[0]