1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
diff -ru bl-1.2.orig/bl.1 bl-1.2/bl.1
--- bl-1.2.orig/bl.1 Sun Feb 18 05:13:05 1996
+++ bl-1.2/bl.1 Tue Dec 18 16:50:01 2001
@@ -21,6 +21,8 @@
.Pp
The options are:
.Bl -tag -width flag
+.It Fl B
+Don't run on the background. Usefull when debugging and profiling.
.It Fl l
lights blink from left to right.
.It Fl r
diff -ru bl-1.2.orig/bl.c bl-1.2/bl.c
--- bl-1.2.orig/bl.c Sun Feb 18 05:14:15 1996
+++ bl-1.2/bl.c Tue Dec 18 16:51:40 2001
@@ -115,6 +115,7 @@
char tty[10] = "/dev/"; /* device name */
extern char *optarg; /* for getopt() */
time_t now; /* current time */
+ int background = 1; /* background or foreground */
/* check args and print out message if necessary */
if(strcmp("-h",argv[argc - 1]) == 0 || strcmp("--help",argv[argc - 1]) == 0
@@ -141,8 +142,11 @@
ioctl(ttyfd,KDGETLED,&savedleds);
/* get options */
- while((c = getopt(argc,argv,"rlbkcd:NCS")) != -1)
+ while((c = getopt(argc,argv,"Brlbkcd:NCS")) != -1)
switch(c) {
+ case 'B':
+ background = 0;
+ break;
case 'd':
/* set new delay */
if(optarg != NULL) delay = atoi(optarg);
@@ -177,6 +181,11 @@
break;
}
+ /* daemonisation - Piotr Roszatycki <dexter@debian.org> */
+ if (background) {
+ daemon(0,0);
+ }
+
/* call blinking functions */
switch(dir) {
case BL_RIGHT:
@@ -313,6 +322,7 @@
printf("This is free software with ABSOLUTELY NO WARRANTY.\n");
printf("For details, type '%s -w'.\n",name);
printf("Usage: %s [-rlbckwNCS] [-d time] <device>\n",name);
+ printf("-B don't run on the background");
printf("-r blink right\n");
printf("-l blink left\n");
printf("-b bounce (right, then left)\n");
|